Module: ActiveCharts::Helpers::ScatterPlotHelper
- Defined in:
- lib/active_charts/helpers/scatter_plot_helper.rb
Instance Method Summary collapse
- #scatter_plot(collection, options = {}) ⇒ Object
- #scatter_plot_for(resource_collection, columns = [], options = {}) ⇒ Object
Instance Method Details
#scatter_plot(collection, options = {}) ⇒ Object
8 9 10 |
# File 'lib/active_charts/helpers/scatter_plot_helper.rb', line 8 def scatter_plot(collection, = {}) ScatterPlot.new(collection, ).to_html end |
#scatter_plot_for(resource_collection, columns = [], options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/active_charts/helpers/scatter_plot_helper.rb', line 12 def scatter_plot_for(resource_collection, columns = [], = {}) return scatter_plot([[]], ) unless Util.valid_collection?(resource_collection) parser = CollectionParser.new(resource_collection, columns, [:label_column]) series_labels = [:series_labels] || parser.xy_series_labels = .merge(series_labels: series_labels, rows: parser.rows) scatter_plot(parser.xy_collection, ) end |