Is there a way to disable the auto scaling of y-axis when I'm zooming on a time series chart ?
You can observe the behavior here : https://codesandbox.io/s/react-chartjs-2-line-zoom-pan-9cz0eh When you zoom the y-axis will scale so the data occupies all the y-axis space.
My zoom plugin looks like this :
plugins = Object.assign({
"title": {
display: true,
text: title,
align: "start"
},
"legend": {
position: "bottom",
},
"zoom": {
zoom: {
wheel: {
enabled: true,
},
pinch: {
enabled: true
},
mode: 'x',
},
pan: {
enabled: true,
mode: 'x',
}
}, ect ...
)}
Then my plugins variable is stored inside options
and I return my chart like that :
return (
<div>
<Chart ref={canvas} id={id ?? null} type={type} data={data} options={options} />
</div>
)
I found in the documentation that you can set a min/max value to your y-axis and that you could play with that to have a fixed axis but that's not applicable for me I think because I don't know in advance what is the data I display and the component is used to display multiple charts