JFreeChart Maximum Zoom Out

点点圈 提交于 2019-12-14 03:55:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!