将一个jfree条形图添加到滚动窗格中 [英] Add a jfree bar chart into a scroll pane
问题描述
我有一个JFree条形图。则使用DefaultCategoryDataset,
填充数据集。可能存在域和范围轴上的值使得这些值不是非常清晰可见的情况。
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.
我需要一个像scrollPane这样的图表可以添加。但它看起来像ChartPanel不能添加到JScrollPane
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
有任何方法这样做吗?
感谢Bhavya
推荐答案
您可以使用 setLowerMargin()
code> getUpperMargin()上的 CategoryAxis
以改善外观。或者,您可以使用 SlidingCategoryDataset
以及 JSlider
。
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
.
附录:A第三个选择是使用缩放,它是默认启用的,如图所示此处。
Addendum: A third alternative is to use zooming, which is enabled by default, as shown here.
这篇关于将一个jfree条形图添加到滚动窗格中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!