Module: ChartBibz::Helpers::ChartHelper

Defined in:
lib/chart_bibz/helpers/chart_helper.rb

Overview

Helper for chart bibz

Instance Method Summary collapse

Instance Method Details

#chart(data = {}, options = {}, html_options = {}) ⇒ String

Generate the html of the canvas

Examples:

Generate the canvas

chart {datasets: {data: [1,2,3]}}, {type: :bar}, {class: "My-chart"}

Parameters:

  • data (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})
  • html_options (Hash) (defaults to: {})

Returns:

  • (String)

    HTML

See Also:



22
23
24
# File 'lib/chart_bibz/helpers/chart_helper.rb', line 22

def chart(data = {}, options = {}, html_options = {})
  ChartBibz::ViewComponents::ChartViewComponent.new(data, options, html_options).render
end