Difference between revisions of "List of charts"
Line 53: | Line 53: | ||
chart = chartMaker.getCategoryChart("Bar", chartTitle, "Category", "value", dataTable, no_category, pairs, "") | chart = chartMaker.getCategoryChart("Bar", chartTitle, "Category", "value", dataTable, no_category, pairs, "") | ||
+ | chartPanel = new ChartPanel(chart, false); | ||
+ | </pre> | ||
+ | | Bar2D Horizontial || [[image:chart_Bar2d_h.jpg|thumb|none|150px]] || [[image:chart_Bar2d_h_data.jpg]] || <pre> | ||
+ | ChartGenerator_JTable chartMaker = new ChartGenerator_JTable(); | ||
+ | |||
+ | int no_series = dataTable.getRowCount()-1; | ||
+ | int no_category = dataTable.getColumnCount()-2; | ||
+ | int[][] pairs = new int[no_category][2]; | ||
+ | for (int i=0; i<no_category; i++){ | ||
+ | pairs[i][0] = i+1; //column i store category i | ||
+ | pairs[i][1] = 0; //column 0 stores series name | ||
+ | } | ||
+ | |||
+ | chart = chartMaker.getCategoryChart("Bar", chartTitle, "Category", "value", dataTable, no_category, pairs, "horizontal") | ||
chartPanel = new ChartPanel(chart, false); | chartPanel = new ChartPanel(chart, false); | ||
</pre> | </pre> | ||
|- | |- | ||
+ | | Bar3D || [[image:chart_Bar3d.jpg|thumb|none|150px]] || [[image:chart_Bar3d_data.jpg]] || <pre> | ||
+ | ChartGenerator_JTable chartMaker = new ChartGenerator_JTable(); | ||
+ | |||
+ | int no_series = dataTable.getRowCount()-1; | ||
+ | int no_category = dataTable.getColumnCount()-2; | ||
+ | int[][] pairs = new int[no_category][2]; | ||
+ | for (int i=0; i<no_category; i++){ | ||
+ | pairs[i][0] = i+1; //column i store category i | ||
+ | pairs[i][1] = 0; //column 0 stores series name | ||
+ | } | ||
+ | |||
+ | chart = chartMaker.getCategoryChart("Bar", chartTitle, "Category", "value", dataTable, no_category, pairs, "3D") | ||
+ | chartPanel = new ChartPanel(chart, false); | ||
+ | </pre> | ||
|} | |} | ||
− | All options for the | + | All options for the getCategoryChart method: <strong>horizontal/vertical, 3D, stacked/layered/waterfall, year/month/day/minute</strong>. Vertical is default. |
Revision as of 18:51, 19 June 2006
- Pie Chart
All options for the getPieChart method: 2D/3D/ring, clockwise/counter_clockwise. 2D is default.
- Bar Chart
Chart | Chart data in JTable | Sample code | |||||
---|---|---|---|---|---|---|---|
Bar2D | Error creating thumbnail: File missing |
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable(); int no_series = dataTable.getRowCount()-1; int no_category = dataTable.getColumnCount()-2; int[][] pairs = new int[no_category][2]; for (int i=0; i<no_category; i++){ pairs[i][0] = i+1; //column i store category i pairs[i][1] = 0; //column 0 stores series name } chart = chartMaker.getCategoryChart("Bar", chartTitle, "Category", "value", dataTable, no_category, pairs, "") chartPanel = new ChartPanel(chart, false); |
Bar2D Horizontial | Error creating thumbnail: File missing |
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable(); int no_series = dataTable.getRowCount()-1; int no_category = dataTable.getColumnCount()-2; int[][] pairs = new int[no_category][2]; for (int i=0; i<no_category; i++){ pairs[i][0] = i+1; //column i store category i pairs[i][1] = 0; //column 0 stores series name } chart = chartMaker.getCategoryChart("Bar", chartTitle, "Category", "value", dataTable, no_category, pairs, "horizontal") chartPanel = new ChartPanel(chart, false); | ||
Bar3D | File:Chart Bar3d data.jpg | ChartGenerator_JTable chartMaker = new ChartGenerator_JTable(); int no_series = dataTable.getRowCount()-1; int no_category = dataTable.getColumnCount()-2; int[][] pairs = new int[no_category][2]; for (int i=0; i<no_category; i++){ pairs[i][0] = i+1; //column i store category i pairs[i][1] = 0; //column 0 stores series name } chart = chartMaker.getCategoryChart("Bar", chartTitle, "Category", "value", dataTable, no_category, pairs, "3D") chartPanel = new ChartPanel(chart, false); |
All options for the getCategoryChart method: horizontal/vertical, 3D, stacked/layered/waterfall, year/month/day/minute. Vertical is default.