marianogappa / chart

Quick & smart charting for STDIN
https://marianogappa.github.io/chart/
MIT License
549 stars 27 forks source link

Chart.js' scatter line charts care about data point ordering #19

Closed marianogappa closed 7 years ago

marianogappa commented 7 years ago

The following dataset

2 4
1 3
4 4
3 3

Yields the following scatter line chart

screen shot 2017-07-05 at 8 24 08 pm

While this behaviour is very flexible, I believe anyone wanting to plot a scatter line chart would expect the x values to be sorted, and this should be the default behaviour.

The aforementioned issue also happens when the x axis is composed of time-based data points.

marianogappa commented 7 years ago

After the above commits, the scatter line chart looks like this:

screen shot 2017-07-09 at 7 36 54 pm