In LightningChart-JS how to reverse the x-axis numbers from ascending to descending

Viewed 76

I have a lineseries chart using LightningChart-JS, I need the x-axis numbers to be in descending order. The order of how the x,y points were added we're in descending order. Please help.

test lineseries

1 Answers

To invert the Axis, you can use Axis.setInterval.

chart.getDefaultAxisX().setInterval(1, -1)

As long as automatic fitting is enabled, the actual values don't matter. Rather the key part is that the start value is higher than end value, resulting in inverted axis.

Related