lib/high_chart_series.rb
def multi_series(series_name_attribute, attribute_of_interest, chart_data, series_options={})
      series = []

      for datum in chart_data
        if datum.kind_of?(Hash)
          series << self.single_series(datum.fetch(series_name_attribute), attribute_of_interest, datum.fetch(attribute_of_interest))
        else
          series << self.single_series(datum.send(series_name_attribute.to_sym), attribute_of_interest, datum.send(attribute_of_interest.to_sym))
        end
      end

      return series
    end
# builds an array of series to make a chart more interesting
# series_name_attribute - string of method to call to get series name
# attribute_of_interest - method with the numeric data to build the chart
# chart_data - array of query results with which to build a series
builds an array of series to make a chart more interesting
series_name_attribute - string of method to call to get series name
attribute_of_interest - method with the numeric data to build the chart
chart_data - array of query results with which to build a series
builds an array of series to make a chart more interesting series_name_attribute - string of method to call to get series name attribute_of_interest - method with the numeric data to build the chart chart_data - array of query results with which to build a series
def multi_series(series_name_attribute, attribute_of_interest, chart_data, series_options={})
      series = []
      for datum in chart_data
        if datum.kind_of?(Hash)
          series << self.single_series(datum.fetch(series_name_attribute), attribute_of_interest, datum.fetch(attribute_of_interest))
        else
          series << self.single_series(datum.send(series_name_attribute.to_sym), attribute_of_interest, datum.send(attribute_of_interest.to_sym))
        end
      end
      return series
    end
def multi_series ( series_name_attribute , attribute_of_interest , chart_data , series_options = { } ) series = [ ] for datum in chart_data if datum . kind_of? ( Hash ) series << self . single_series ( datum . fetch ( series_name_attribute ) , attribute_of_interest , datum . fetch ( attribute_of_interest ) ) else series << self . single_series ( datum . send ( series_name_attribute . to_sym ) , attribute_of_interest , datum . send ( attribute_of_interest . to_sym ) ) end end return series end
builds an array of series to make a chart more interesting
series_name_attribute - string of method to call to get series name
attribute_of_interest - method with the numeric data to build the chart
chart_data - array of query results with which to build a series
builds an array of series to make a chart more interesting series_name_attribute - string of method to call to get series name attribute_of_interest - method with the numeric data to build the chart chart_data - array of query results with which to build a series
series_name_attribute
attribute_of_interest
chart_data
series_options