I am using a linear chart and using it to visualise waveshapes that can be quite complex. The application requires the data y range to be pre-scaled based on variable external requirements, with typical limits being from (-10:0) through to (-500:0). By default, without an initial pre-scaled y axis, the chart dynamically rescales itself as the data arrives.
I need to pre-set the chartjs variable into the chart structure prior to sending the data. Below I have called it the hypothetical .
scales: {
y: {
min: <NewNegativeValue>,
max: 0,
stepSize: 10,
title:
etc
I presume I can set this value in the same way I use javascript to set the other chart settings. What I don’t understand is how to write it into the chart structure.
I spent several hours searching the web and although the concept of dynamic scaling is discussed, in all the cases I could find they dealt with examining the data and using the Math() function or something similar. In my case I know all about the data before calling the chart. I just need to know how to set the y value via javascript prior to sending the data.
Ron