add scrollbar to JFreeChart 3DBarChart

大城市里の小女人 提交于 2019-11-27 08:59:39

问题


Can I add a scroll bar to the JFreeChart that allows me horizontally move the bar ?

JFreeChart chart = ChartFactory.createBarChart3D(
    title, 
    "X",
    "Y",
    dataset, 
    PlotOrientation.VERTICAL, 
    true, 
    false, 
    false
);

Because the dataset could be very long that there's not enough width to show the result...

Can I use JSlide on it? or other methods?

If possible, please show me some sample code. Thank you!


回答1:


.Yes you can, if you have access to the JFreeChart demo code just modify SlidingCategoryDatasetDemo2 and replace createBarChart3D with createBarChart3D and you will get this:

You will need to use a SlidingCategoryDataset. You can find the source code and demos here JFreeChart



来源:https://stackoverflow.com/questions/10754747/add-scrollbar-to-jfreechart-3dbarchart

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