Class: ChartBibz::ViewComponents::ChartViewComponent
- Inherits:
-
ApplicationViewComponent
- Object
- ApplicationViewComponent
- ChartBibz::ViewComponents::ChartViewComponent
- Defined in:
- lib/chart_bibz/view_components/chart_view_component.rb
Overview
Generate the chart view through the render method
Instance Attribute Summary
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
-
#canvas ⇒ Object
Get the Canvas with new html_options.
-
#initialize(data = {}, options = {}, html_options = {}) ⇒ void
constructor
Need of CanvasViewComponent to work.
-
#render ⇒ String
Generate the html canvas.
Constructor Details
#initialize(data = {}, options = {}, html_options = {}) ⇒ void
Need of CanvasViewComponent to work
26 27 28 29 30 |
# File 'lib/chart_bibz/view_components/chart_view_component.rb', line 26 def initialize(data = {}, = {}, = {}) @data = data = = end |
Instance Method Details
#canvas ⇒ Object
Get the Canvas with new html_options
52 53 54 |
# File 'lib/chart_bibz/view_components/chart_view_component.rb', line 52 def canvas @canvas ||= CanvasViewComponent.new() end |
#render ⇒ String
Generate the html canvas
41 |
# File 'lib/chart_bibz/view_components/chart_view_component.rb', line 41 delegate :render, to: :canvas |