1
votes

I'm using Spring Boot and Chartjs. I have a question.Can I set min max axis depend on the data?? For example, my data is [25.11, 29.36]. How do I can set min value of x axis is 25 and max value of x axis is 30? And if the next value is 23.66 (data will be [25.11, 29.36, 23.66]), min value of x axis will change from 25 to 23. Thanks for your help.

1

1 Answers

0
votes

Usually the chart rearranges itself quite good after each data change.

If you want to force min and max values you have to update/override the options of your chart with Math.floor() and Math.ceil() whenever your data changes.