app/controllers/surveyor_gui/reports_controller.rb
def generate_histogram_chart(q, responses)

    suffix = q.suffix

    responses = q.responses

    # helpful charting info with the labels set and statistics
    histarray = HistogramArray.new(q, responses.where(:question_id => q.id), suffix).calculate

=begin
    @chart[q.id.to_s] = LazyHighCharts::HighChart.new('graph') do |f|
      f.options[:chart][:defaultSeriesType] = 'column'
      f.options[:title][:text] = 'Histogram for "' + q.text + '"'
      f.options[:legend][:enabled] = false
      f.options[:xAxis][:categories] = histarray.map { |h| h[:x] }
      f.options[:xAxis][:labels] = { :rotation => -45, :align => 'right' }
      f.options[:yAxis][:min] = 0
      f.options[:yAxis][:title] = { :text => 'Occurrences' }
      f.plot_options(
          :pointPadding => true,
          :borderWidth => 0,
          :enableMouseTracking => false,
          :shadow => false,
          :animation => false
      )
      f.series(:data => histarray.map { |h| h[:y] },
               :dataLabels => {
                   :enabled => true
               }
      )
    end
=end

  end
# show intervals with statistics for the # of responses for the question
#  (a.k.a "intervals with box plots" or 'box and whiskers' charts)
show intervals with statistics for the # of responses for the question
(a.k.a "intervals with box plots" or 'box and whiskers' charts)
show intervals with statistics for the # of responses for the question ( a . k . a " intervals with box plots " or ' box and whiskers ' charts )
def generate_histogram_chart(q, responses)
    suffix = q.suffix
    responses = q.responses
    histarray = HistogramArray.new(q, responses.where(:question_id => q.id), suffix).calculate
  end
def generate_histogram_chart ( q , responses ) suffix = q . suffix responses = q . responses histarray = HistogramArray . new ( q , responses . where ( :question_id => q . id ) , suffix ) . calculate end
show intervals with statistics for the # of responses for the question
(a.k.a "intervals with box plots" or 'box and whiskers' charts)
show intervals with statistics for the # of responses for the question ( a . k . a " intervals with box plots " or ' box and whiskers ' charts )
# helpful charting info with the labels set and statistics =begin
    @chart[q.id.to_s] = LazyHighCharts::HighChart.new('graph') do |f|
      f.options[:chart][:defaultSeriesType] = 'column'
      f.options[:title][:text] = 'Histogram for "' + q.text + '"'
      f.options[:legend][:enabled] = false
      f.options[:xAxis][:categories] = histarray.map { |h| h[:x] }
      f.options[:xAxis][:labels] = { :rotation => -45, :align => 'right' }
      f.options[:yAxis][:min] = 0
      f.options[:yAxis][:title] = { :text => 'Occurrences' }
      f.plot_options(
          :pointPadding => true,
          :borderWidth => 0,
          :enableMouseTracking => false,
          :shadow => false,
          :animation => false
      )
      f.series(:data => histarray.map { |h| h[:y] },
               :dataLabels => {
                   :enabled => true
               }
      )
    end
=end
q
responses