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.
pull/1/head
David Schnur 13 years ago
parent 6412dafc6e
commit 790bbaf55f

@ -74,7 +74,8 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
format.push({ y: true, number: true, required: true }); format.push({ y: true, number: true, required: true });
if (s.bars.show || (s.lines.show && s.lines.fill)) { 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) { if (s.bars.horizontal) {
delete format[format.length - 1].y; delete format[format.length - 1].y;
format[format.length - 1].x = true; format[format.length - 1].x = true;

Loading…
Cancel
Save