Class: RCharts::GraphHelper::Tooltips::TooltipBuilder
- Inherits:
-
ElementBuilder
- Object
- ElementBuilder
- RCharts::GraphHelper::Tooltips::TooltipBuilder
- Defined in:
- app/helpers/rcharts/graph_helper/tooltips/tooltip_builder.rb
Overview
Tooltip Builder
Instance Method Summary collapse
-
#name ⇒ Object
:attr_accessor:.
-
#series ⇒ Object
Renders one or more series present in the data.
Methods inherited from ElementBuilder
Instance Method Details
#name ⇒ Object
:attr_accessor:
10 |
# File 'app/helpers/rcharts/graph_helper/tooltips/tooltip_builder.rb', line 10 attribute :name |
#series ⇒ Object
Renders one or more series present in the data. For each series yields an EntryBuilder which contains the index, key, and value. See EntryBuilder for details.
<%= graph_for @annual_sales do |graph| %>
<%= graph.tooltips do |category| %>
<h4><%= category.name %></h4>
<%= category.series do |series| %>
<%= series.name %>
<%= series.value %>
<% end %>
<% end %>
<% end %>
26 27 28 29 30 31 32 |
# File 'app/helpers/rcharts/graph_helper/tooltips/tooltip_builder.rb', line 26 def series(**, &) capture do .each_key.with_index do |key, index| concat series_tag(key, index, **, &) end end end |