edu.ucla.stat.SOCR.chart
Class ChartGenerator_JTable

java.lang.Object
  extended by edu.ucla.stat.SOCR.chart.ChartGenerator_JTable

public class ChartGenerator_JTable
extends java.lang.Object

This class provide the API interface for creating many type's charts including PieChart, BarChart, LineChart, etc

JTable is used as input data type for the chart.

The output data type is JFreeChart which is implemented using the Java 2D APIs and can be easily included in GUI.


Field Summary
protected  int CHART_SIZE_X
           
protected  int CHART_SIZE_Y
           
 
Constructor Summary
ChartGenerator_JTable()
           
 
Method Summary
 JFreeChart createEmptyChart(java.lang.String title)
          this generates an empty chart, used in init
 JFreeChart getBoxAndWhiskerCategoryChart(java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, javax.swing.JTable table, int numberOfCategory, int[][] pairs, java.lang.String other)
          given category data, this method will generate a BoxAndWhisker Chart
 JFreeChart getCategoryChart(java.lang.String chartType, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, javax.swing.JTable table, int numberOfCategory, int[][] pairs, java.lang.String other)
          given category data, this method will generate a Bar Chart, Line Chart, Area Chart or Step Chart
 JFreeChart getCompassChart(java.lang.String title, javax.swing.JTable table, int numberOfSeries, int[][] pairs, java.lang.String other)
          given a sigle data, this method will generate a compass Chart
 JFreeChart getPieChart(java.lang.String title, javax.swing.JTable table, int[][] pairs, java.lang.String other)
          this will generate a Pie Chart
 JFreeChart getTableXYAreaChart(java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, javax.swing.JTable table, int numberOfSeries, int[][] pairs, java.lang.String other)
          given XY data, this method will generate a stacked Area Chart
 JFreeChart getXYChart(java.lang.String chartType, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, javax.swing.JTable table, int numberOfSeries, int[][] pairs, java.lang.String other)
          given XY data, this method will generate a Bar Chart, Line Chart, Area Chart etc
 JFreeChart getXYZBubbleChart(java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, javax.swing.JTable table, int numberOfSeries, int[][] pairs, java.lang.String other)
          given XYZ data, this method will generate a Bubble Chart
 JFreeChart getYIntervalChart(java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, javax.swing.JTable table, int numberOfSeries, int[][] pairs, java.lang.String other)
          given XY data, this method will generate a YInterval Chart
 void setChartSize(int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHART_SIZE_X

protected int CHART_SIZE_X

CHART_SIZE_Y

protected int CHART_SIZE_Y
Constructor Detail

ChartGenerator_JTable

public ChartGenerator_JTable()
Method Detail

setChartSize

public void setChartSize(int x,
                         int y)

createEmptyChart

public JFreeChart createEmptyChart(java.lang.String title)
this generates an empty chart, used in init

Parameters:
title - the chart title

getPieChart

public JFreeChart getPieChart(java.lang.String title,
                              javax.swing.JTable table,
                              int[][] pairs,
                              java.lang.String other)
this will generate a Pie Chart

Parameters:
title - chart title
table - chart data
pairs - data table mapping info
other - can be 2D/3D/ring/clockwise/counter_colckwise

getCategoryChart

public JFreeChart getCategoryChart(java.lang.String chartType,
                                   java.lang.String title,
                                   java.lang.String xLabel,
                                   java.lang.String yLabel,
                                   javax.swing.JTable table,
                                   int numberOfCategory,
                                   int[][] pairs,
                                   java.lang.String other)
given category data, this method will generate a Bar Chart, Line Chart, Area Chart or Step Chart

Parameters:
charType - can be bar/barstat/barstatraw/line/linestat/area/step/areatime/spiderweb/eventfreqtime
title - chart title
xlabel - X axis label
yLabel - Y axis label
table - chart data
numberOfCategory - number of category in dataTable
pairs - data table mapping info
other - can be 3d/stacked/layered/waterfall for bar chart, noshap/noline/nofill for line chart, minute/day/month/year for areatime chart

getXYChart

public JFreeChart getXYChart(java.lang.String chartType,
                             java.lang.String title,
                             java.lang.String xLabel,
                             java.lang.String yLabel,
                             javax.swing.JTable table,
                             int numberOfSeries,
                             int[][] pairs,
                             java.lang.String other)
given XY data, this method will generate a Bar Chart, Line Chart, Area Chart etc

Parameters:
charType - can be line/linetime/lineqq/lineqqdd/bar/area/step/areatime/nd/differencetime/symbolicaxis/polar
title - chart title
xlabel - X axis label
yLabel - Y axis label
table - chart data
numberOfSeries - number of series in dataTable
pairs - data table mapping info
other - can be noshap/noline/nofill for line chart, minute/day/month/year for areatime chart and differencetime chart

getTableXYAreaChart

public JFreeChart getTableXYAreaChart(java.lang.String title,
                                      java.lang.String xLabel,
                                      java.lang.String yLabel,
                                      javax.swing.JTable table,
                                      int numberOfSeries,
                                      int[][] pairs,
                                      java.lang.String other)
given XY data, this method will generate a stacked Area Chart

Parameters:
title - chart title
xlabel - X axis label
yLabel - Y axis label
table - chart data
numberOfSeries - number of series in dataTable
pairs - data table mapping info
other - is not currently used

getYIntervalChart

public JFreeChart getYIntervalChart(java.lang.String title,
                                    java.lang.String xLabel,
                                    java.lang.String yLabel,
                                    javax.swing.JTable table,
                                    int numberOfSeries,
                                    int[][] pairs,
                                    java.lang.String other)
given XY data, this method will generate a YInterval Chart

Parameters:
title - chart title
xlabel - X axis label
yLabel - Y axis label
table - chart data
numberOfSeries - number of series in dataTable
pairs - data table mapping info
other - is not currently used

getBoxAndWhiskerCategoryChart

public JFreeChart getBoxAndWhiskerCategoryChart(java.lang.String title,
                                                java.lang.String xLabel,
                                                java.lang.String yLabel,
                                                javax.swing.JTable table,
                                                int numberOfCategory,
                                                int[][] pairs,
                                                java.lang.String other)
given category data, this method will generate a BoxAndWhisker Chart

Parameters:
title - chart title
xlabel - X axis label
yLabel - Y axis label
table - chart data
numberOfCategory - number of Catgory in dataTable
pairs - data table mapping info
other - is not currently used

getXYZBubbleChart

public JFreeChart getXYZBubbleChart(java.lang.String title,
                                    java.lang.String xLabel,
                                    java.lang.String yLabel,
                                    javax.swing.JTable table,
                                    int numberOfSeries,
                                    int[][] pairs,
                                    java.lang.String other)
given XYZ data, this method will generate a Bubble Chart

Parameters:
title - chart title
xlabel - X axis label
yLabel - Y axis label
table - chart data
numberOfSeries - number of Series in dataTable
pairs - data table mapping info
other - is not currently used

getCompassChart

public JFreeChart getCompassChart(java.lang.String title,
                                  javax.swing.JTable table,
                                  int numberOfSeries,
                                  int[][] pairs,
                                  java.lang.String other)
given a sigle data, this method will generate a compass Chart

Parameters:
title - chart title
table - chart data
numberOfSeries - number of Series in dataTable
pairs - data table mapping info
other - is not currently used