score:0

while sending data from the server, you can send min and max value as well, and then use suggestedmin and suggestedmax

yaxes: [{
    ticks: {
        suggestedmin: receivedminval - 10,
        suggestedmax: receivedmaxval + 10,
        }
    }
}]

where received val refers to the value sent from the server. you can also use a js function to find the min and max values from the array. suggested values will always increase the value by keeping the ratio of stepsize.

if you would like to learn more about this, read the documentation. you could read all about it at https://www.chartjs.org/docs/latest/axes/cartesian/linear.html#axis-range-settings


Related Query

More Query from same tag