Open 10man opened 1 year ago
I wouldn't mind doing the work if someone can point me in the right direction. That is, if anyone but me thinks it would be useful...
I took a brief look but I don't know this codebase so I wasn't sure where the bast place to start was. I would offer to do the maxRange
https://github.com/chartjs/chartjs-plugin-zoom/issues/756 update as well if that would help. Seems like that would be in the same area...
Could you show an example? (I can keep 0 in view by doing a drag zoom, and I can't imagine other examples.)
To me, the proposal (below) seems a bit confusing due to the names.
limits: {
y: {
min: 'original'|value,
max: 'original'|value,
minRange: value,
maxMin: 'original'|value,
minMax: 'original'|value
}
}
How about this instead (with some extensions):
limits: {
y: {
min: 'original' | 'locked' | value | { min: value, max: value },
max: 'original' | 'locked' | value | { min: value, max: value },
minRange: value,
maxRange: value,
}
}
Hello,
First off, thanks for the plugin, super awesome. :tophat: I'm using the latest (as of 06-11-23) from cdn.jsdelivr for both chart.js and the plugin.
The idea here is to fix (or limit) an axis value and have the zoom affect the data scale in a separately controllable fashion. For example; say we have a dataset that extends away from 0 and we want to zoom keeping 0 in view.
Currently we have:
I purpose the following:
Where:
minMax
sets the maximum value that themin
scale could take under zoom.maxMin
sets the minimum value that themax
scale could take under zoom. Setting tooriginal
would have the standard implications. Now, if bothmin
andminMax
were set tooriginal
, that would disable changes to that scale value under zoom.