Module: Trackplot::ChartHelper

Defined in:
app/helpers/trackplot/chart_helper.rb

Instance Method Summary collapse

Instance Method Details

#trackplot_chart(data, **options, &block) ⇒ Object



3
4
5
6
7
# File 'app/helpers/trackplot/chart_helper.rb', line 3

def trackplot_chart(data, **options, &block)
  builder = ChartBuilder.new(data, **options)
  capture(builder, &block) if block_given?
  builder.render(self)
end

#trackplot_sparkline(data, key:, **options) ⇒ Object



9
10
11
12
# File 'app/helpers/trackplot/chart_helper.rb', line 9

def trackplot_sparkline(data, key:, **options)
  builder = SparklineBuilder.new(data, key: key, **options)
  builder.render(self)
end