Class: RCharts::GraphHelper::Series::SeriesBuilder
- Inherits:
-
ElementBuilder
- Object
- ElementBuilder
- RCharts::GraphHelper::Series::SeriesBuilder
- Defined in:
- app/helpers/rcharts/graph_helper/series/series_builder.rb
Overview
Series Builder
Instance Method Summary collapse
-
#area ⇒ Object
Renders the series as an area plot.
-
#index ⇒ Object
:attr_accessor: index.
-
#line ⇒ Object
Renders the series as a line plot.
-
#name ⇒ Object
:attr_accessor:.
-
#scatter ⇒ Object
Renders the series as a scatter plot.
Methods inherited from ElementBuilder
Instance Method Details
#area ⇒ Object
Renders the series as an area plot. Passes through :data, and :aria, and :class options to the tag builder.
<%= graph_for @sales do |graph| %>
<%= graph.series do |series| %>
<%= series.area smooth: 0.12 %>
<% end %>
<% end %>
Options
:smooth-
Smoothing factor for the area.
:axis-
The axis for the series. Defaults to the first continuous axis.
:inline_axis-
The axis for the categories. Defaults to the first discrete axis.
48 49 50 |
# File 'app/helpers/rcharts/graph_helper/series/series_builder.rb', line 48 def area(**) area_tag(sign: :positive, **) + area_tag(sign: :negative, **) end |
#index ⇒ Object
:attr_accessor: index
14 |
# File 'app/helpers/rcharts/graph_helper/series/series_builder.rb', line 14 attribute :index, :integer, default: 0 |
#line ⇒ Object
Renders the series as a line plot. Passes through :data, and :aria, and :class options to the tag builder.
<%= graph_for @sales do |graph| %>
<%= graph.series do |series| %>
<%= series.line smooth: 0.12 %>
<% end %>
<% end %>
Options
:smooth-
Smoothing factor for the line.
:axis-
The axis for the series. Defaults to the first continuous axis.
:inline_axis-
The axis for the categories. Defaults to the first discrete axis.
32 33 34 |
# File 'app/helpers/rcharts/graph_helper/series/series_builder.rb', line 32 def line(**) path_tag(**) end |
#name ⇒ Object
:attr_accessor:
10 |
# File 'app/helpers/rcharts/graph_helper/series/series_builder.rb', line 10 attribute :name |
#scatter ⇒ Object
Renders the series as a scatter plot. Passes through :data, and :aria, and :class options to the tag builder.
<%= graph_for @sales do |graph| %>
<%= graph.series do |series| %>
<%= series.scatter %>
<% end %>
<% end %>
Options
:marker_size-
Size of the markers. Defaults to
10.0. :marker_margin-
Margin around the marker symbol. Defaults to
2.0. :marker_id-
ID of a custom marker symbol (a
<symbol>element). :axis-
The axis for the series. Defaults to the first continuous axis.
:inline_axis-
The axis for the categories. Defaults to the first discrete axis.
65 66 67 |
# File 'app/helpers/rcharts/graph_helper/series/series_builder.rb', line 65 def scatter(**) scatter_tag(**) end |