Commit 6412dafc authored by David Schnur's avatar David Schnur

Restrict zero to bars and filled lines only.

This also includes a tweak to zero's default.  Previously zero only
received a value if lines were visible; now it always receives a value,
matching the behavior of other contextual options.
parent b6924a96
...@@ -504,7 +504,7 @@ Licensed under the MIT license. ...@@ -504,7 +504,7 @@ Licensed under the MIT license.
// If nothing was provided for lines.zero, default it to match // If nothing was provided for lines.zero, default it to match
// lines.fill, since areas by default should extend to zero. // lines.fill, since areas by default should extend to zero.
if (s.lines.show && s.lines.zero == null) { if (s.lines.zero == null) {
s.lines.zero = !!s.lines.fill; s.lines.zero = !!s.lines.fill;
} }
...@@ -556,7 +556,7 @@ Licensed under the MIT license. ...@@ -556,7 +556,7 @@ Licensed under the MIT license.
format.push({ x: true, number: true, required: true }); format.push({ x: true, number: true, required: true });
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 || s.lines.zero))) { if (s.bars.show || (s.lines.show && s.lines.fill)) {
var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero)); 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 }); format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
if (s.bars.horizontal) { if (s.bars.horizontal) {
......
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