Commit 790bbaf5 authored by David Schnur's avatar David Schnur

Mirror the zero option to the categories plugin.

Due to limitations in our plugin architecture, the categories plugin
duplicates code from Flot's core for adding a dummy point to snap the y
axis to zero.  We can get rid of this duplication in 0.9; for now we'll
just update the duplicate to match the change in core that introduced
the new 'zero' option.
parent 6412dafc
......@@ -74,7 +74,8 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
format.push({ y: true, number: true, required: true });
if (s.bars.show || (s.lines.show && s.lines.fill)) {
format.push({ y: true, number: true, required: false, defaultValue: 0 });
var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
if (s.bars.horizontal) {
delete format[format.length - 1].y;
format[format.length - 1].x = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment