gillius / jfxutils

JavaFX Utilities - Zoom and Pan Charts and Pane Scaling
Apache License 2.0
68 stars 22 forks source link

its possible to only zoom x axis #16

Open ghost opened 6 years ago

ghost commented 6 years ago

hi in my project, i need to only zoom x axis, but not y axis. its possible?

gillius commented 6 years ago

I believe you can achieve what you want with the ChartZoomManager by setting an axis constraint strategy that always returns horizontal (or only returns that if you are within the plot area or axis if you want). There is a org.gillius.jfxutils.chart.ChartZoomManager#setAxisConstraintStrategy used with mouse drag events, and org.gillius.jfxutils.chart.ChartZoomManager#setMouseWheelAxisConstraintStrategy used with wheel events.

ghost commented 6 years ago

hi, thanks for your repl. I have self solved this problem. but its only a point, For me, in order to not modify your lib, i have create classes to extend Chart JFXChartUtils and PayManager to modify something fpr panManager and chartZommManager, that i want to. Because from pinmanager instance i cant do that.

So i am thinking, whether its good, that user can directly get pinManager and chartZoomManager instance to modify that. image