I would like my mouse scrollwheel to do the same zoom as clicking zoom->both-axes. Is there an example of that or can someone suggest the best way to do it?
Thanks
Using the mouse scrollwheel to zoom in/out ?
-
- Posts: 45
- Joined: Thu Jun 26, 2014 8:24 am
- antibot: No, of course not.
- Location: Germany, Aachen
Re: Using the mouse scrollwheel to zoom in/out ?
If you extend the ChartPanel, you can actually set it via "super"
I actually never tried to use "setDomainZoomable(boolean flag)" or "setRangeZoomable(boolean flag)", but i guess that´ll work too.
Code: Select all
public CustomChartPanel(JFreeChart chart)
{
//the fifth boolean is actually for "zoom" and the scrollwheel is default
super(chart, false, true, false, true, true);
}
Re: Using the mouse scrollwheel to zoom in/out ?
turns out I just needed chartPanel.setMouseWheelEnabled(true);