JFreeChart in NetBeans
下載JFreeChart套件,解壓縮後找到以下兩jar檔
1. jfreechart-1.0.0-rc1.jar:這是 JFreeChart 主要的類別程式庫
2. jcommon-1.0.0-rc1.jar:提供 JFreeChart 底層操作所需要的各項類別
開啟NetBeans並建立一個新專案(NetBeans > File > New Project... >Gerenal >Java Application)
專案按右鍵 > Properties >Libraries > Add JAR/Folder > 選取以上兩個jar檔將之匯入即完成
之後再程式碼開頭只需導入所需的JFreeChart類別即可
(import org.jfree.chart.* ; 、
import org.jfree.data.general.DefaultPieDataset ;)
1. jfreechart-1.0.0-rc1.jar:這是 JFreeChart 主要的類別程式庫
2. jcommon-1.0.0-rc1.jar:提供 JFreeChart 底層操作所需要的各項類別
開啟NetBeans並建立一個新專案(NetBeans > File > New Project... >Gerenal >Java Application)
專案按右鍵 > Properties >Libraries > Add JAR/Folder > 選取以上兩個jar檔將之匯入即完成
之後再程式碼開頭只需導入所需的JFreeChart類別即可
(import org.jfree.chart.* ; 、
import org.jfree.data.general.DefaultPieDataset ;)
Creating charts with JFreeChart is a three step process. You need to:
• create a dataset containing the data to be displayed in the chart;
• create a JFreeChart object that will be responsible for drawing the chart;
• draw the chart to some output target (often, but not always, a panel on
the screen);
留言
張貼留言