List of charts

From Socr

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
*Pie Chart
+
*'''Pie Chart'''
{| border="1"
{| border="1"
|+ Pie Charts  
|+ Pie Charts  
Line 34: Line 34:
|}
|}
-
All options for the getPieChart method:  <strong> 2D/3D/ring, clockwise/counter_clockwise</strong>.    2D is default.
+
All options for the getPieChart method:  <strong> 2D/3D/ring, clockwise/counter_clockwise</strong>.    ''2D'' is default.
-
*Bar Chart
+
-------
 +
 
 +
*'''Bar Chart'''
{| border="1"
{| border="1"
|+ Bar Charts  
|+ Bar Charts  
Line 85: Line 87:
  chartPanel = new ChartPanel(chart, false);  
  chartPanel = new ChartPanel(chart, false);  
  </pre>
  </pre>
 +
|-
 +
| Layered  Bar|| [[image:chart_Bar_layered.jpg|thumb|none|150px]] || [[image:chart_Bar_layered_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, "layered");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
| Stacked Bar || [[image:chart_Bar_stacked.jpg|thumb|none|150px]] || [[image:chart_Bar_stacked_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, "stacked");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
|Waterfall Bar || [[image:chart_Waterfall.jpg|thumb|none|150px]] || [[image:chart_Waterfall_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", "Product Cost Breakdown",
 +
            "Expense Category",
 +
            "Cost Per Unit", dataTable, no_category, pairs, "waterfall");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
|Statistical Bar || [[image:chart_Statbar.jpg|thumb|none|150px]] || [[image:chart_Statbar_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("BarStat", chartTitle, "Type", "value", dataTable, no_category, pairs, "");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
 +
|-
 +
|Statistical Bar with Raw Data|| [[image:chart_Statbar_raw.jpg|thumb|none|150px]] || [[image:chart_Statbar_raw_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("BarStatRaw", chartTitle, "Type", "value", dataTable, no_category, pairs, "");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|}
|}
-
All options for the getCategoryChart method:  <strong>horizontal/vertical,  3D,  stacked/layered/waterfall, year/month/day/minute</strong>.    Vertical  is default.
+
All options for the getCategoryChart method:  <strong>horizontal/vertical,  3D,  stacked/layered/waterfall, year/month/day/minute</strong>.    ''Vertical'' is default.

Revision as of 17:02, 20 June 2006

  • Pie Chart
Pie Charts
Chart Chart data in JTable Sample code
PieChart2D
image:chart_Pie2_data.jpg
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
int[][] pairs = new int[1][2];
pairs[0][0] = 1;   // value
pairs[0][1] = 0;   // name

chart = chartMaker.getPieChart(chartTitle, dataTable, pairs,"");
chartPanel = new ChartPanel(chart, false); 
PieChart3D with rotation
image:Chart_Pie3d_data.jpg
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
int[][] pairs = new int[1][2];
pairs[0][0] = 1;   // value
pairs[0][1] = 0;   // name

chart = chartMaker.getPieChart(chartTitle, dataTable, pairs,"3D counter_clockwise");
chartPanel = new ChartPanel(chart, false); 
RingChart
image:chart_Ring_data.jpg
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
int[][] pairs = new int[1][2];
pairs[0][0] = 1;   // value
pairs[0][1] = 0;   // name

chart = chartMaker.getPieChart(chartTitle, dataTable, pairs,"ring");
chartPanel = new ChartPanel(chart, false); 

All options for the getPieChart method: 2D/3D/ring, clockwise/counter_clockwise. 2D is default.


  • Bar Chart
Bar Charts
Chart Chart data in JTable Sample code
Bar2D
image:chart_Bar2d_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, "")
 chartPanel = new ChartPanel(chart, false); 
 
Bar2D Horizontial
image:chart_Bar2d_h_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, "horizontal")
 chartPanel = new ChartPanel(chart, false); 
 
Bar3D
image: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); 
 
Layered Bar
image:chart_Bar_layered_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, "layered");
 chartPanel = new ChartPanel(chart, false); 
 
Stacked Bar
image:chart_Bar_stacked_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, "stacked");
 chartPanel = new ChartPanel(chart, false); 
 
Waterfall Bar
image:chart_Waterfall_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", "Product Cost Breakdown",
		            "Expense Category",
		            "Cost Per Unit", dataTable, no_category, pairs, "waterfall");
 chartPanel = new ChartPanel(chart, false); 
 
Statistical Bar
image:chart_Statbar_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("BarStat", chartTitle, "Type", "value", dataTable, no_category, pairs, "");
 chartPanel = new ChartPanel(chart, false); 
 
Statistical Bar with Raw Data
image:chart_Statbar_raw_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("BarStatRaw", chartTitle, "Type", "value", dataTable, no_category, pairs, "");
 chartPanel = new ChartPanel(chart, false); 
 

All options for the getCategoryChart method: horizontal/vertical, 3D, stacked/layered/waterfall, year/month/day/minute. Vertical is default.

Personal tools