If a yAxis range is specified as an option, and the data values went beyond that range, PlotKit previously bounded the points to the yAxis range, meaning the gradients of the lines before and after that point were wrong. I have now implemented a proper clipping algorithm which adds additional points if necessary, representing a cut-off/flattened curve.
Previously _evaluateLimits searched for the globally maximum x and y values in the datasets, and adjusted the boundaries of the axes accordingly. However, this is does not always do what you would expect: Imagine, for example, you've got the dataset of a stock price over several years, and you've set the xAxis option to zoom in on a small area of that data. The variation of the value over that short period would be much less than the variation over the course of serveral years, and accordingly you would expect the scale to be adjusted to the selected xAxis range. I have changed the behaviour of _evaluateLimits so that it takes the xAxis option into account unless a yAxis option is also specified.
I removed the condition 'if (this.style != "area")' because the "area" chart type does not exist anywhere else. I'm not sure if this was accidentally left in the code after some refactoring in the past, or if it was the beginnings of a new feature. In any case, I think that it makes sense that the points in a dataset should be sorted before connecting them up with a line, whether or not this creates an area graph. Unless you want to be able to create graphs which wrap back on themselves on the x axis... but that should probably be a completely different layout type anyway.
…sed and doesn't add anything much.
Previously PlotKit was bad at handling large values in charts (see tests/bignums.html). This patch introduces a more structured approach to choosing axis scaling. It's not perfect yet as the definition of what constitutes a "good" scaling still needs tweaking to match intuition.
Conflicts: PlotKit/EasyPlot.js PlotKit/Layout.js PlotKit/PlotKit_Packed.js PlotKit/SweetCanvas.js tests/axis.html tests/basic.html tests/debug.html tests/demo-svg.html tests/demo.html tests/dynamic.html tests/labels-img.html tests/labels.html tests/prototype_compat.html tests/quickstart-easy.html tests/quickstart-horiz.html tests/quickstart-neg.html tests/quickstart-svg.html tests/quickstart.html tests/svg-sweet.html tests/svg.html tests/sweet.html
…be generic functions (modifying a color argument). Added support for a new 'fillColor' option for setting a fixed fill color (similar to 'strokeColor'). Refactored stroke and fill color handling to reuse the same code instead of copying it everywhere.
filled polygon with all the data points in the graph. Useful for drawing min-max charts of values (requires some pre-processing though).
mistakenly identical to SweetCanvas). Also fixed a bunch of minor stylistic issue in the rendering and increased configurability somewhat.
are now drawn in the correct color with a white outline (in the sweet canvas) instead of all being white.
false. Also updated the packed version of PlotKit from recent patches.
_evaluateBarCharts and _evaluateHorizBarChart in Layout.js. To do this, the new method _barChartXDelta was added to correctly calculate the xdelta value used in both bar chart _evaluate methods. The _uniqueXValues method was also modified to accept an array argument whose elements are added to the returned array of values. The _uniqueXValues method is adapted to allow the correct array to be returned for the bar chart _evaluate methods without effecting the returned value elsewhere where it is used. A few trailing whitespaces were also removed.
in the horizontal bar chart. Patch from Kieren Chapman.