Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to revert x-axe values in line chart with chart.js

I am using chart.js and i have line chart with values from 10 to 100. My top point have value 100, but that is incorrect for my data. For me 100 is the bad result. Is there a way to revert x-axe to start from 100 to 10.

If its not possible, can someone recommend javascript (NO jQuery) chart, that can resolve my problem?

like image 607
Petroff Avatar asked Oct 31 '22 08:10

Petroff


1 Answers

Try this in your chart options :

scaleOverride: true,   
scaleSteps: 10,
scaleStartValue: 100,
scaleStepWidth: -10

it shoud just do the trick.

See a jsfiddle of it here.

like image 85
rtome Avatar answered Nov 08 '22 06:11

rtome