Open trufflesprouts opened 9 months ago
you can autorange/reset any scale by setting its min and max to null
. the x scale is special, and setting it to any min/max will also reset/re-range all the y scales (assuming that they still have their original range
fns). if you want to simulate what double-click does, you can do u.setScale('x', {min: null, max: null})
or u.setScale('x', {min: u.data[0][0], max: u.data[0].at(-1)})
.
i tried setting it to null but it doesn't work as expected https://jsfiddle.net/7pzqbdy1/61/ the second solution works
let's leave this open. since i think null/null should work.
I'm trying to add a button to reset all scales similar to the way that double click works. Is there way to invoke the built in implementation of double click? or any clean way of doing this?
My current solution is saving the initial min and max in
_range
then setting the scale to be that value.Another solution is emitting a double click event on
u-over
which seems a bit hacky.