Class: RailsDataExplorer::Chart::DescriptiveStatisticsTable

Inherits:
RailsDataExplorer::Chart show all
Defined in:
lib/rails-data-explorer/chart/descriptive_statistics_table.rb

Instance Attribute Summary

Attributes inherited from RailsDataExplorer::Chart

#output_buffer

Instance Method Summary collapse

Methods inherited from RailsDataExplorer::Chart

#dom_id, #render?

Constructor Details

#initialize(_data_set, options = {}) ⇒ DescriptiveStatisticsTable

Returns a new instance of DescriptiveStatisticsTable.



5
6
7
8
# File 'lib/rails-data-explorer/chart/descriptive_statistics_table.rb', line 5

def initialize(_data_set, options = {})
  @data_set = _data_set
  @options = {}.merge(options)
end

Instance Method Details

#renderObject



10
11
12
13
14
15
16
17
18
# File 'lib/rails-data-explorer/chart/descriptive_statistics_table.rb', line 10

def render
  return ''  unless render?
  (:div, id: dom_id, class: 'rde-chart rde-descriptive-statistics-table') do
    @data_set.data_series.map { |data_series|
      (:h3, "Descriptive Statistics", class: 'rde-chart-title') +
      render_html_table(data_series.descriptive_statistics_table)
    }.join.html_safe
  end
end