From 790bbaf55f4ce4c6539831aa6c4febdb341ef19e Mon Sep 17 00:00:00 2001 From: David Schnur Date: Thu, 10 Jan 2013 09:59:45 -0500 Subject: [PATCH] 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. --- jquery.flot.categories.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.flot.categories.js b/jquery.flot.categories.js index 5bc2396..ec314bf 100644 --- a/jquery.flot.categories.js +++ b/jquery.flot.categories.js @@ -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;