问题
I am working with JFreeChart to create a line graph via an XYPlot which is embedded into an application. The graph is contained within a ChartPanel and added to the background panel of my GUI.
My issue is that the XYPlot appears so zoomed in that I am unable to see any of the lines; simply the whitespace background each side of them!
Is there a way to view the component at its "maximum zoomed out" state so that the graph is understandable?
Many thanks :)
回答1:
The setZoomInFactor() method works well for this, but you'll have to define maximum to choose the factor. This example shows how to add a control that manipulates the zoom state.
回答2:
Maybe, you should try to use
getChartPanel().zoomInRange(1, 2);
getChartPanel().restoreAutoBounds()
Sometimes, only zoomOut just didn't worked for me, so I added zoomIn first and all worked well
来源:https://stackoverflow.com/questions/9931852/jfreechart-maximum-zoom-out