Class: RailsDataExplorer::Chart::DescriptiveStatisticsTable
- Inherits:
-
RailsDataExplorer::Chart
- Object
- RailsDataExplorer::Chart
- RailsDataExplorer::Chart::DescriptiveStatisticsTable
- Defined in:
- lib/rails_data_explorer/chart/descriptive_statistics_table.rb
Overview
Responsibilities:
* Render a table with descriptive statistics for a data series of any type.
Collaborators:
* DataSet
Instance Attribute Summary
Attributes inherited from RailsDataExplorer::Chart
Instance Method Summary collapse
-
#initialize(_data_set, options = {}) ⇒ DescriptiveStatisticsTable
constructor
A new instance of DescriptiveStatisticsTable.
- #render ⇒ Object
Methods inherited from RailsDataExplorer::Chart
Constructor Details
#initialize(_data_set, options = {}) ⇒ DescriptiveStatisticsTable
Returns a new instance of DescriptiveStatisticsTable.
14 15 16 17 |
# File 'lib/rails_data_explorer/chart/descriptive_statistics_table.rb', line 14 def initialize(_data_set, = {}) @data_set = _data_set @options = {}.merge() end |
Instance Method Details
#render ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/rails_data_explorer/chart/descriptive_statistics_table.rb', line 19 def render return '' unless render? content_tag(:div, id: dom_id, class: 'rde-chart rde-descriptive-statistics-table') do @data_set.data_series.map { |data_series| content_tag(:h3, "Descriptive Statistics", class: 'rde-chart-title') + render_html_table(data_series.descriptive_statistics_table) }.join.html_safe end end |