|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectplanetj.chart.ChartManager
Helper class that may be used to create charts and graphs from given RowCollections or Rows. Properties that are needed to create the charts are contained within a chart specification property group. This class uses JFreeChart behind the scenes.
ChartSpecificationPG,
IChartTypes| Field Summary |
| Fields inherited from interface planetj.chart.IChartTypes |
HORIZONTAL_BAR, HORIZONTAL_BAR_3D, HORIZONTAL_BAR_3D_KEY, HORIZONTAL_BAR_KEY, LINE, LINE_KEY, PIE, PIE_3D, PIE_3D_KEY, PIE_KEY, UNKNOWN, VERTICAL_BAR, VERTICAL_BAR_3D, VERTICAL_BAR_3D_KEY, VERTICAL_BAR_KEY |
| Constructor Summary | |
protected |
ChartManager()
ChartManager constructor. |
| Method Summary | |
protected com.jrefinery.chart.JFreeChart |
createCategoryChart(int type,
java.lang.String title,
java.lang.String categoryAxisLabel,
java.lang.String valueAxisLabel,
com.jrefinery.data.CategoryDataset data,
boolean legend,
boolean tooltips,
boolean urls)
Creates a category chart with the given information. |
com.jrefinery.chart.JFreeChart |
createCategoryChart(RowCollection data,
ChartSpecificationPG chartSpecs)
|
com.jrefinery.chart.JFreeChart |
createChart(RowCollection data,
ChartSpecificationPG chartSpecs)
Convience method to create a JFreeChart given the data and chart specifications. |
protected java.lang.Number[][] |
extractCategoryData(RowCollection rc,
java.util.List columnNames,
boolean plotByRow)
Extracts values from the given RowCollection to create a double array of Numeric values that can be used to create a category chart. |
com.jrefinery.data.CategoryDataset |
getCategoryDataset(RowCollection rc,
ChartSpecificationPG chartSpecs)
Creates a CategoryDataset using the given chart specifications and data. |
ChartSpecificationPG |
getChartSpecifications(java.lang.String chartId,
RowCollection rc)
Convience method to retrieve a chart specification property group that has the given chart id from a given RowCollection. |
int |
getType(java.lang.String type)
Gets the type of chart to generate from the given chart abbreviation key. |
static void |
setSingleton(ChartManager singleton)
Allow subclasses to be set as the signleton instance to use. |
static ChartManager |
singleton()
Gets the singleton instance of ChartManager. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected ChartManager()
| Method Detail |
protected com.jrefinery.chart.JFreeChart createCategoryChart(int type,
java.lang.String title,
java.lang.String categoryAxisLabel,
java.lang.String valueAxisLabel,
com.jrefinery.data.CategoryDataset data,
boolean legend,
boolean tooltips,
boolean urls)
throws ChartException
type - type of category chart (see IChartTypes for supported types)title - the chart title.categoryAxisLabel - the label for the category axis.valueAxisLabel - the label for the value axis.data - the dataset for the chart.legend - a flag specifying whether or not a legend is required.tooltips - configure chart to generate tool tips?urls - configure chart to generate URLs?
ChartException
public com.jrefinery.chart.JFreeChart createCategoryChart(RowCollection data,
ChartSpecificationPG chartSpecs)
throws CMException
CMException
public com.jrefinery.chart.JFreeChart createChart(RowCollection data,
ChartSpecificationPG chartSpecs)
throws CMException
data - RowCollection containing data to chart.chartSpecs - properties on how the chart should be generated.
CMException
protected java.lang.Number[][] extractCategoryData(RowCollection rc,
java.util.List columnNames,
boolean plotByRow)
throws CMException
rc - RowCollection containing valuescolumnNames - if plotting by row, these names will be the names of the columns
for each category in the series; if not plotting by row, then these
are the columns containing the series of values; if no columns are
given, then by default all columns are used.plotByRow - true if series values should be taken from the row; false if from columns
CMException
public com.jrefinery.data.CategoryDataset getCategoryDataset(RowCollection rc,
ChartSpecificationPG chartSpecs)
throws CMException
CMException
public ChartSpecificationPG getChartSpecifications(java.lang.String chartId,
RowCollection rc)
chartId - id of the chart to retrieve chart specifications for.rc - RowCollection containing chart property groups.public int getType(java.lang.String type)
type - chart abbreviation key used to get the chart type
public static void setSingleton(ChartManager singleton)
singleton - helper class to use as the ChartManager.public static ChartManager singleton()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||