# http://johan.github.io/d3/ex/box.html # http://bl.ocks.org/mbostock/4061502 class RailsDataExplorer class Chart class BoxPlot < Chart def initialize(_data_set, options = {}) @data_set = _data_set @options = {}.merge(options) end def compute_chart_attrs x_ds = @data_set.data_series.first return false if x_ds.nil? { values: [x_ds.values], min: x_ds.min_val, max: x_ds.max_val, base_width: 120, base_height: 800, axis_tick_format: x_ds.axis_tick_format, } end def render return '' unless render? ca = compute_chart_attrs return '' unless ca %(