How can I add a horizontal scroll bar in JFreeChart?

时光毁灭记忆、已成空白 提交于 2020-01-03 05:33:33

问题


Can I include a horizontal scroll bar to view the previous data in a JFreechart? I am using linechart graph to draw dynamic graph and showing 10 values on x-axis at a time, I want to view the graph with a horizontal scroll bar.

How can I set the values for scrollbar to view the previous data?


回答1:


Several options are available:

  • Adding your ChartPanel to a JScrollPane,

  • Using a SlidingXYDataset, mentioned here,

  • Using a paging approach, illustrated here.

  • Addendum: Using a SlidingCategoryDataset with ChartFactory.createLineChart().



来源:https://stackoverflow.com/questions/11807984/how-can-i-add-a-horizontal-scroll-bar-in-jfreechart

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