Module: D3Charts::ViewHelpers

Defined in:
lib/d3_charts/view_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



8
9
10
11
12
# File 'lib/d3_charts/view_helpers.rb', line 8

def self.included klass
  klass.class_eval do
    include ActionView::Context
  end
end

Instance Method Details

#area_chart(chart_data, options = {}) ⇒ Object




22
23
24
# File 'lib/d3_charts/view_helpers.rb', line 22

def area_chart chart_data, options={}
  Chart::Area.new(chart_data, options).tag.html_safe
end

#pie_chart(chart_data, options = {}) ⇒ Object




16
17
18
# File 'lib/d3_charts/view_helpers.rb', line 16

def pie_chart chart_data, options={}
  Chart::Pie.new(chart_data, options).tag.html_safe
end