Class: RCharts::GraphHelper::LegendEntryBuilder

Inherits:
ElementBuilder show all
Defined in:
app/helpers/rcharts/graph_helper/legend_entry_builder.rb

Overview

Legend Entry Builder

Instance Method Summary collapse

Methods inherited from ElementBuilder

#render_in

Instance Method Details

#indexObject

:attr_accessor: index



13
# File 'app/helpers/rcharts/graph_helper/legend_entry_builder.rb', line 13

attribute :index, :integer, default: 0

#nameObject

:attr_accessor:



9
# File 'app/helpers/rcharts/graph_helper/legend_entry_builder.rb', line 9

attribute :name

#symbolObject

Renders the symbol associated with the series. You can override this on a per-series basis using :series_options with GraphHelper#graph_for. To change the global set of symbols and colors, see RCharts.symbol_for and RCharts.color_class_for.

<%= graph_for @annual_sales do |graph| %>
  <%= graph.tooltips do |category| %>
    <h4><%= category.name %></h4>
    <%= category.series do |series| %>
      <%= series.symbol %>
      <%= series.name %>
    <% end %>
  <% end %>
<% end %>


29
30
31
# File 'app/helpers/rcharts/graph_helper/legend_entry_builder.rb', line 29

def symbol
  tag.span symbol_character, class: ['series-symbol', color_class]
end