assertEquals([12, 18], g.xAxisRange());
assertEquals([10, 40], g.yAxisRange(0));
+ g.updateOptions({ valueRange: [10, NaN] });
+ assertEquals([12, 18], g.xAxisRange());
+ assertEquals([10, 44.2], g.yAxisRange(0));
+
+ g.updateOptions({ valueRange: [10, 40] });
+ assertEquals([12, 18], g.xAxisRange());
+ assertEquals([10, 40], g.yAxisRange(0));
+
g.updateOptions({ });
assertEquals([12, 18], g.xAxisRange());
assertEquals([10, 40], g.yAxisRange(0));
"labels": ["Axis display"],
"type": "Array of two numbers",
"example": "[10, 110]",
- "description": "Explicitly set the vertical range of the graph to [low, high]. This may be set on a per-axis basis to define each y-axis separately."
+ "description": "Explicitly set the vertical range of the graph to [low, high]. This may be set on a per-axis basis to define each y-axis separately. You can specify only one limit and let other one (replaced by NaN) to be calculated automatically, by exemple [NaN,30]"
},
"labelsDivWidth": {
"default": "250",
axis.computedValueRange = [axis.valueWindow[0], axis.valueWindow[1]];
} else if (axis.valueRange) {
// This is a user-set value range for this axis.
- axis.computedValueRange = [axis.valueRange[0], axis.valueRange[1]];
+ axis.computedValueRange = [
+ !isNaN(axis.valueRange[0]) ? axis.valueRange[0] : axis.extremeRange[0],
+ !isNaN(axis.valueRange[1]) ? axis.valueRange[1] : axis.extremeRange[1]
+ ];
} else {
axis.computedValueRange = axis.extremeRange;
}