Add a jfree bar chart into a scroll pane

烈酒焚心 提交于 2019-12-24 21:23:27

问题


I have a JFree Bar Chart. the dataset is populated using DefaultCategoryDataset , There may be situations when the values on both the domain and range axis are such that these values are not very clearly visible.

I need something like a scrollPane into which the chart can be added. But it looks like the ChartPanel cannot be added into a JScrollPane

Is there any way of doing this ?

Thanks Bhavya


回答1:


You can use setLowerMargin() and/or getUpperMargin() on the relevant CategoryAxis to improve the appearance. Alternatively, you can use a SlidingCategoryDataset in conjunction with a JSlider.

Addendum: A third alternative is to use zooming, which is enabled by default, as shown here.



来源:https://stackoverflow.com/questions/6448724/add-a-jfree-bar-chart-into-a-scroll-pane

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