jquery.sparkline
jquery.sparkline copied to clipboard
Reversing order of y-axis values
The standard behaviour of sparkline is that values grow from lowest to highest along the vertical axis, i.e. (0,0) at bottom left.
Feature request: It would be great to have it the other way round, i.e., that the lowest value starts at the top and the highest value is at the bottom. (0,0) would, thus, be in the upper left corner.
(I tried a workaround by multiplying with -1 but the result is not satisfying.)
+1
Any update on this feature? I too need reverse Y-axis feature.
+1
@das-shrike I managed to work around this by reversing the chart and unreversing the tooltip using the formatter.
- Multiplied everything by -1 and added to the sparkline chart
- Added this:
tooltipFormatter: function(sparkline, options, point) {
return Math.abs(point.y)+'º '+Math.abs(options.userOptions.tooltipValueLookups.points.map[point.y]) + ' pts.';
},
To the options, which returns Xº Z pts.
(in my case that just did it).