問題描述
我在我的 java 應用程序中使用 JFreeChart.
I am using JFreeChart in my java application.
問題
我想繪制一個 XYAreaChart,當我們開始繪制數據時,它的 域軸(x 軸) 應該會自動水平滾動.
I want to plot a XYAreaChart whose domain axis (x-axis) should scroll horizontally automatically when we start plotting the data.
我在 TimeSeriesCharts 中看到了同樣的內容,但我不想要任何 timeSeriesChart.我只想要滾動的 x 軸.
I saw the same thing in TimeSeriesCharts but I don't want any timeSeriesChart. I just want the scrolling x-axis.
推薦答案
您需要創建自己的 SlidingXYDataset
來實現 XYDataset 的方式類似于 SlidingCategoryDataset
實現 CategoryDataset
.
You'll need to create your own SlidingXYDataset
that implements XYDataset in a manner similar to how SlidingCategoryDataset
implements CategoryDataset
.
附錄:如 評論中所述,一個典型的實現可以在here找到.
Addendum: As noted in a comment, a typical implementation can be found here.
這篇關于JFreeChart - 創建移動圖表時出現問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!