class RailsDataExplorer::Chart::DescriptiveStatisticsTable

Responsibilities:

* Render a table with descriptive statistics for a data series of any type.

Collaborators:

* DataSet

Public Class Methods

new(_data_set, options = {}) click to toggle source
# File lib/rails_data_explorer/chart/descriptive_statistics_table.rb, line 13
def initialize(_data_set, options = {})
  @data_set = _data_set
  @options = {}.merge(options)
end

Public Instance Methods

render() click to toggle source
# File lib/rails_data_explorer/chart/descriptive_statistics_table.rb, line 18
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