[英]How do i create XY Chart in Java with two variables?
我在用Java生成XY圖表時遇到問題。 我有三個物體,對於它們,我確定價格和重量。 現在,我有兩個生成兩個圖表:一個圖表在對象的x軸上,而價格在y上,另一個圖表在y軸上有權重。 我創建了按鈕,並為第一個圖表聲明了graphmodifier = 1,為第二個圖表聲明了graphmodifier = 2。
碼:
private XYDataset createDataSet() { String[] data = inputStringData();
storeData(data);
XYSeries series1 = new XYSeries("");
if (graphmodifier == 1) {
series1 = new XYSeries("Price");
for (int i = 0; i < speed.length; i++) {
}
} else {
series1 = new XYSeries("weigh");
}
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(series1);
return dataset;
}
檢查一下,唯一的缺點是它是商業>> >> http://www.softwarefx.com/products/chartfx/?selPlat=VS
看看這個。 它具有豐富的功能,並且也是免費的。 http://www.jfree.org/jfreechart/samples.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.