List of charts

From Socr

(Difference between revisions)
Jump to: navigation, search
Line 167: Line 167:
|-
|-
-
|XY BarChart''*'' || [[image:chart_Xybar.jpg|thumb|none|150px]] || [[image:chart_Xybar_data.jpg]]  || <pre>
+
|XY BarChart using XYDataset|| [[image:chart_Xybar.jpg|thumb|none|150px]] || [[image:chart_Xybar_data.jpg]]  || <pre>
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
Line 182: Line 182:
|}
|}
-
All options for the getCategoryChart method:  <strong>horizontal/vertical,  3D,  stacked/layered/waterfall, year/month/day/minute</strong>.     ''Vertical'' is default.
+
Bar chart can be created using either getCategoryChart or getXYChart method depend on the data.   
-
''*'' The XYBarChart uses getXYChart method.
+
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 getXYChart method:  <strong>horizontal/vertical,  noline/nofill/noshape,  year/month/day/minute</strong>.    ''Vertical''  is default.
--------------
--------------
Line 194: Line 195:
!  !! Chart !! Chart data in JTable !! Sample code  
!  !! Chart !! Chart data in JTable !! Sample code  
|-
|-
-
| PieChart2D  || [[image:chart_Line.jpg|thumb|none|150px]] || [[image:chart_Line_data.jpg]]  || <pre>
+
| Line chart using CategoryDataset || [[image:chart_Line.jpg|thumb|none|150px]] || [[image:chart_Line_data.jpg]]  || <pre>
  ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
  ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
Line 206: Line 207:
  chart = chartMaker.getCategoryChart("Line", "Category Chart", "Release", "Class Count", dataTable, no_category, pairs,"nofill");
  chart = chartMaker.getCategoryChart("Line", "Category Chart", "Release", "Class Count", dataTable, no_category, pairs,"nofill");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
!  !! Chart !! Chart data in JTable !! Sample code
 +
|-
 +
| Line Chart using XYDataset || [[image:chart_Line.jpg|thumb|none|150px]] || [[image:chart_Line_data.jpg]]  || <pre>
 +
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
 +
 +
int no_series = (dataTable.getColumnCount()-2)/2;
 +
int[][] pairs = new int[no_series][2];
 +
for (int i=0; i<no_series; i++){
 +
pairs[i][0] = 2*i;    //column x
 +
pairs[i][1] = 2*i+1;    //column y
 +
}
 +
chart = chartMaker.getXYChart("Line",chartTitle, "X", "Y", dataTable, no_series, pairs,"");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
| Scatter Line Chart  || [[image:chart_Scatter.jpg|thumb|none|150px]] || [[image:chart_Scatter_data.jpg]]  || <pre>
 +
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
 +
 +
int no_series = (dataTable.getColumnCount()-2)/2;
 +
int[][] pairs = new int[no_series][2];
 +
for (int i=0; i<no_series; i++){
 +
pairs[i][0] = 2*i;    //column x
 +
pairs[i][1] = 2*i+1;    //column y
 +
}
 +
chart = chartMaker.getXYChart("Line","Line Chart", "X", "Y", dataTable, no_series, pairs,"noline");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
| QQData2Data Chart  || [[image:chart_Dd.jpg|thumb|none|150px]] || [[image:chart_Dd_data.jpg]]  || <pre>
 +
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
 +
 +
int no_series = dataTable.getColumnCount()/2;
 +
int[][] pairs = new int[no_series][2];
 +
for (int i=0; i<no_series; i++){
 +
pairs[i][0] = 2*i;    //column x
 +
pairs[i][1] = 2*i+1;    //column y
 +
}
 +
chart = chartMaker.getXYChart("LineQQDD","QQD2D Chart", "Group1", "Group 2", dataTable, no_series, pairs,"");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
| QQNormal Chart  || [[image:chart_Qq.jpg|thumb|none|150px]] || [[image:chart_Qq_data.jpg]]  || <pre>
 +
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
 +
 +
int no_series = dataTable.getColumnCount(); //one y column only 
 +
int[][] pairs = new int[no_series][2];
 +
for (int i=0; i<no_series; i++){
 +
pairs[i][0] = 0;    // there is no x column
 +
pairs[i][1] = 0;    //column y
 +
}
 +
chart = chartMaker.getXYChart("LineQQ","QQNormalPlot Chart", "Data", "NormalDistribution of Data", dataTable, no_series, pairs,"");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
| NormalDistrribution Chart  || [[image:chart_Nd.jpg|thumb|none|150px]] || [[image:chart_Nd_data.jpg]]  || <pre>
 +
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
 +
int[][] pairs = new int[1][2];
 +
pairs[0][0] = 0;  //mean
 +
pairs[0][1] = 1;  // stdDev
 +
chart = chartMaker.getXYChart("ND","Normaldistribution Chart", "X", "Y", dataTable, 1, pairs, "noshape nofill ");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
|-
 +
| StatisticalLine Chart  || [[image:chart_Statline.jpg|thumb|none|150px]] || [[image:chart_Statline_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("LineStat", "LineChart", "Type", "value", dataTable, no_category, pairs,"");
 +
chartPanel = new ChartPanel(chart, false);
 +
</pre>
 +
| StatisticalLine Chart  using raw data|| [[image:chart_Statline_raw.jpg|thumb|none|150px]] || [[image:chart_Statline_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("LineStatRaw", "LineChart", "Type", "value", dataTable, no_category, pairs,"");
  chartPanel = new ChartPanel(chart, false);  
  chartPanel = new ChartPanel(chart, false);  
</pre>
</pre>
|}
|}
-
All options for the getCategoryChart method:  <strong>horizontal/vertical,  noline/nofill/noshape,  year/month/day/minute</strong>.    ''Vertical''  is default.
+
Line chart can be created using either getCategoryChart or getXYChart method depend on the data. 
 +
 
 +
All options for the getXYChart method:  <strong>horizontal/vertical,  noline/nofill/noshape,  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 20:50, 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 Horizontal Layout
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); 
 
XY BarChart using XYDataset
image:chart_Xybar_data.jpg
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();

int no_series = (dataTable.getColumnCount()-2)/2;
int[][] pairs = new int[no_series][2];
 for (int i=0; i<no_series; i++){
	 pairs[i][0] = i*2;    //column 1 stores value
	 pairs[i][1] = i*2+1;    //column 0 stores time
	 }
 chart = chartMaker.getXYChart("Bar",chartTitle, "Category", "value", dataTable, no_series, pairs,"Year");
 chartPanel = new ChartPanel(chart, false);  

Bar chart can be created using either getCategoryChart or getXYChart method depend on the data.

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

All options for the getXYChart method: horizontal/vertical, noline/nofill/noshape, year/month/day/minute. Vertical is default.


  • Line Chart
Line Charts
Chart Chart data in JTable Sample code
Line chart using CategoryDataset
image:chart_Line_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("Line", "Category Chart", "Release", "Class Count", dataTable, no_category, pairs,"nofill");
 chartPanel = new ChartPanel(chart, false); 
Chart Chart data in JTable Sample code
Line Chart using XYDataset
image:chart_Line_data.jpg
 ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
		 
 int no_series = (dataTable.getColumnCount()-2)/2;		 
 int[][] pairs = new int[no_series][2];
 for (int i=0; i<no_series; i++){
	 pairs[i][0] = 2*i;    //column x
	 pairs[i][1] = 2*i+1;    //column y
 }
 chart = chartMaker.getXYChart("Line",chartTitle, "X", "Y", dataTable, no_series, pairs,"");
 chartPanel = new ChartPanel(chart, false); 
Scatter Line Chart
image:chart_Scatter_data.jpg
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
		
 int no_series = (dataTable.getColumnCount()-2)/2;		 
 int[][] pairs = new int[no_series][2];
 for (int i=0; i<no_series; i++){
	 pairs[i][0] = 2*i;    //column x
	 pairs[i][1] = 2*i+1;    //column y
	 }
 chart = chartMaker.getXYChart("Line","Line Chart", "X", "Y", dataTable, no_series, pairs,"noline");
 chartPanel = new ChartPanel(chart, false); 
QQData2Data Chart
image:chart_Dd_data.jpg
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
			
int no_series = dataTable.getColumnCount()/2;		 
 int[][] pairs = new int[no_series][2];
 for (int i=0; i<no_series; i++){
	 pairs[i][0] = 2*i;    //column x
	 pairs[i][1] = 2*i+1;    //column y
	 }
 chart = chartMaker.getXYChart("LineQQDD","QQD2D Chart", "Group1", "Group 2", dataTable, no_series, pairs,"");
 chartPanel = new ChartPanel(chart, false); 
QQNormal Chart
image:chart_Qq_data.jpg
ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
				
 int no_series = dataTable.getColumnCount();	//one y column only  
 int[][] pairs = new int[no_series][2];
 for (int i=0; i<no_series; i++){
	 pairs[i][0] = 0;    // there is no x column
	 pairs[i][1] = 0;    //column y
 }
 chart = chartMaker.getXYChart("LineQQ","QQNormalPlot Chart", "Data", "NormalDistribution of Data", dataTable, no_series, pairs,"");
 chartPanel = new ChartPanel(chart, false); 
NormalDistrribution Chart
image:chart_Nd_data.jpg
 ChartGenerator_JTable chartMaker = new ChartGenerator_JTable();
 int[][] pairs = new int[1][2];
 pairs[0][0] = 0;   //mean 
 pairs[0][1] = 1;   // stdDev
 chart = chartMaker.getXYChart("ND","Normaldistribution Chart", "X", "Y", dataTable, 1, pairs, "noshape nofill ");
chartPanel = new ChartPanel(chart, false); 
StatisticalLine Chart
image:chart_Statline_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("LineStat", "LineChart", "Type", "value", dataTable, no_category, pairs,"");
 chartPanel = new ChartPanel(chart, false); 
StatisticalLine Chart using raw data
image:chart_Statline_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("LineStatRaw", "LineChart", "Type", "value", dataTable, no_category, pairs,"");
 chartPanel = new ChartPanel(chart, false); 

Line chart can be created using either getCategoryChart or getXYChart method depend on the data.

All options for the getXYChart method: horizontal/vertical, noline/nofill/noshape, year/month/day/minute. Vertical is default.

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

Personal tools