Zoom In/Out of Easy Chart Scripting


I’m trying to create buttons so that I can Zoom In and Out of the Domain Range of an Easy Chart. Ultimately I will be hiding the right click popup that has this function. I figured since these options are available in the right click menu and the JFreeChart object has Zoomable methods that scripting a button to accomplish this would be possible. However I can’t seem to get it done correctly so if anyone has any insight on how to access these functions via scripting that would be appreciated. Thanks.

It looks like this is time series data. You could use scripting to change the start and end date for the chart. That should effectively “zoom” in and out.

That makes sense, that’s probably what that function is doing any ways. Thought it was worth asking if a direct function call was available. Thanks!

It’s not what it’s doing. Unfortunately, its ridiculously complicated, and I’d have to spend a few hours with an old project to figure out how to explain it. IIRC, the key was to hijack the chart’s default right-click popup menu and copy its actions to a new popup.

1 Like