简体   繁体   中英

Add a jfree bar chart into a scroll pane

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM