Class: Chartify::WebChart::GoogleChart::AreaChart
- Includes:
- GoogleChartModule
- Defined in:
- lib/chartify/web_chart/google_chart/area_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
Methods inherited from AreaChart
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 18 19 20 |
# File 'lib/chartify/web_chart/google_chart/area_chart.rb', line 10 def render(html_dom_id) js = <<-JS google.load("visualization", "1", {packages:["corechart"], callback:drawChart#{}}); function drawChart#{}() { var data = google.visualization.arrayToDataTable(#{array_data_table.to_json}); var chart = new google.visualization.AreaChart(document.getElementById('#{html_dom_id}')); chart.draw(data, #{.to_json}); } JS js.html_safe end |