Class: GoogleChart::FinancialLineChart

Inherits:
Base
  • Object
show all
Defined in:
lib/google_chart/financial_line_chart.rb

Overview

Generates a Financial Line Chart. This feature is UNDOCUMENTED and EXPERIMENTAL. For a sample usage, visit (right at the bottom) 24ways.org/2007/tracking-christmas-cheer-with-google-charts

Examples

flc = GoogleChart::FinancialLineChart.new do |chart|
   chart.data "", [3,10,20,37,40,25,68,75,89,99], "ff0000"
end
puts flc.to_url

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::COMPLEX_ENCODING_ALPHABET, Base::DEFAULT_LINE_STYLE, Base::SHAPE_MARKERS, Base::SIMPLE_ENCODING

Instance Attribute Summary

Attributes inherited from Base

#chart_size, #chart_title, #chart_type, #data_encoding, #params, #show_legend, #title_color, #title_font_size

Instance Method Summary collapse

Methods inherited from Base

#axis, #data, #fill, #fill_area, #grid, #max_value, #range_marker, #shape_marker, #to_escaped_url, #to_url

Constructor Details

#initialize(chart_size = '100x15', chart_title = nil) {|_self| ... } ⇒ FinancialLineChart

Specify the

  • chart_size in WIDTHxHEIGHT format

  • chart_title as a string

Yields:

  • (_self)

Yield Parameters:



18
19
20
21
22
23
# File 'lib/google_chart/financial_line_chart.rb', line 18

def initialize(chart_size='100x15', chart_title=nil) # :yield: self
  super(chart_size, chart_title)
  self.chart_type = :lfi
  self.show_legend = false
  yield self if block_given?
end

Instance Method Details

#process_dataObject



25
26
27
28
29
# File 'lib/google_chart/financial_line_chart.rb', line 25

def process_data
  join_encoded_data(@data.collect { |series|
        encode_data(series, max_data_value)
      })
end