Class: Compendium::ChartProvider::AmCharts

Inherits:
AbstractChartProvider show all
Defined in:
lib/compendium/chart_provider/amcharts.rb

Overview

Uses the amcharts.rb gem to provide charting

Instance Attribute Summary

Attributes inherited from AbstractChartProvider

#chart

Instance Method Summary collapse

Methods inherited from AbstractChartProvider

find_chart_provider

Constructor Details

#initialize(type, data, &setup_proc) ⇒ AmCharts



5
6
7
# File 'lib/compendium/chart_provider/amcharts.rb', line 5

def initialize(type, data, &setup_proc)
  @chart = chart_class(type).new(data, &setup_proc)
end

Instance Method Details

#render(template, container) ⇒ Object



9
10
11
# File 'lib/compendium/chart_provider/amcharts.rb', line 9

def render(template, container)
  template.amchart(chart, container)
end