问题
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 aJScrollPane
,Using a SlidingXYDataset, mentioned here,
Using a paging approach, illustrated here.
Addendum: Using a
SlidingCategoryDataset
withChartFactory.createLineChart()
.
来源:https://stackoverflow.com/questions/11807984/how-can-i-add-a-horizontal-scroll-bar-in-jfreechart