Topic: Gruff Issue

I've included a long code sample because I'm drawing a blank as to what's wrong with this. Here are the symptoms. The first time I hit this action, it works fine. Subsequent calls to the action show that I'm still looking for the right date range but generate:

ArgumentError (wrong number of arguments (1 for 0)):
    /app/controllers/chart_controller.rb:75:in `initialize'
    /app/controllers/chart_controller.rb:75:in `new'
    /app/controllers/chart_controller.rb:75:in `generate_chart'

the line pointed to (75) is g = Gruff::Bar.new(800), in the code below.

Has anyone had this experience? Any idea how to resolve?

Thanks,

Steve

    def generate_chart
        month_names = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']

        where_elements, where_clause, title = [], '', "Signup Statistics"

        begin_date, end_date, project = params[:begin_date], params[:end_date], params[:project]
       
        begin_date = Member.find(:first, :order => 'created_on ASC').created_on.strftime('%Y-%m-%d') if begin_date == '0' || begin_date.nil?
        end_date = Member.find(:first, :order => 'created_on DESC').created_on.strftime('%Y-%m-%d') if end_date == '0' || end_date.nil?

        if project && project != '0'
            @signups = Member.signups_for_project_by_week(project, begin_date, end_date)

            count_array, point_marker_array = [@signups.size], [@signups.size]
            array_index = 0

            setup_end = Time.now

            g = Gruff::Bar.new(800)
            g.title = title
            g.theme_gruff_ek
            g.font = File.expand_path('public/ttf-bitstream-vera/Vera.ttf', RAILS_ROOT)
            current_data_point = 0

            @signups.first.created_on.to_date.upto(@signups.last.created_on.to_date) do |date|
                g.labels[current_data_point] = month_names[date.month] if date.day == 1
                if date.wday == 0
                    data = @signups.select{|f| f.created_on.to_date == date}
                    if data && !data[0].blank?
                        count_array[current_data_point] = data[0].counter.to_i
                        RAILS_DEFAULT_LOGGER.debug "pushing #{date} #{data[0].counter.to_i}"
                    else
                        count_array[current_data_point] = 0
                    end
                    current_data_point += 1
                end
            end

            g.data(Project.find(params[:project]).name, count_array)
            g.minimum_value = 0
            send_data(g.to_blob,
                :disposition => 'inline',
                :type => 'image/png',
                :filename => "project_stats.png")
        end
    end