Class: Chartify::WebChart::GoogleChart::LineChart

Inherits:
LineChart show all
Includes:
GoogleChartModule
Defined in:
lib/chartify/web_chart/google_chart/line_chart.rb

Instance Attribute Summary

Attributes inherited from ChartBase

#columns, #data, #label_column, #title

Instance Method Summary collapse

Methods included from GoogleChartModule

#array_data_table, #chart_options, #include_js, #timestamp, #wrap_in_function

Methods inherited from LineChart

#to_blob

Methods inherited from ChartBase

#add_row, evaluate_js, #initialize, #render_chart

Constructor Details

This class inherits a constructor from Chartify::ChartBase

Instance Method Details

#render(html_dom_id) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/chartify/web_chart/google_chart/line_chart.rb', line 10

def render(html_dom_id)
  js = "    var data = google.visualization.arrayToDataTable(\#{array_data_table.to_json});\n    var chart = new google.visualization.LineChart(document.getElementById('\#{html_dom_id}'));\n    chart.draw(data, \#{chart_options.to_json});\n  JS\n  wrap_in_function(js).html_safe\nend\n"