public abstract class Chart<P extends Plot> extends AbstractContexed
ChartData
interface) to allow the underlying chart
package to be swapped in and out. Useful helper methods that only use the public ChartData
interface can live in the Chart
object. The data within
a chart is represented by an object implementing the SetPlot
interface that is generated by the ChartData
.
Sub-classes of Chart
have correspondng sub-lcasses of ChartData
and SetPlot
.
The data model is that data is classified into categories/sets. Each set is plotted separately for example as different lines, sectors of a pie-chart or bars on a bar-chart. Charts also support a set of text legends that label the sets.
conn
Modifier | Constructor and Description |
---|---|
protected |
Chart(AppContext conn) |
Modifier and Type | Method and Description |
---|---|
ChartData<P> |
getChartData() |
java.lang.String |
getLegendName() |
P |
makeDataset(int nset)
create a scratch Plot not connected with any graph
|
protected void |
setChartData(ChartData<P> chart) |
void |
setLegendName(java.lang.String legendName) |
void |
sortSets(SetPlot p,
double other_frac)
Sort the sets of Dataset largest first with small sets mapped to an
others category
|
void |
sortSets(SetPlot p,
double other_frac,
int max_plot)
Sort the sets of Dataset largest first with small sets mapped to an
others category the legends for the plots are also permuted.
|
void |
sortSets(SetPlot p,
int max_plot)
Sort the sets of Dataset largest first with small sets mapped to an
others category
|
getContext, getLogger, resetLogger
protected Chart(AppContext conn)
public final P makeDataset(int nset) throws java.lang.Exception
nset
- int number of setsjava.lang.Exception
public final void sortSets(SetPlot p, double other_frac)
other_frac
- fraction of total plot below which a set is mapped to the
Others catagorypublic final void sortSets(SetPlot p, double other_frac, int max_plot)
other_frac
- fraction of total plot below which a set is mapped to the
Others catagorymax_plot
- maximum number of sets to show including Others. zero implies
no limit.public final void sortSets(SetPlot p, int max_plot)
max_plot
- maximum number of sets to show including Others. zero implies
no limit.public final java.lang.String getLegendName()
public final void setLegendName(java.lang.String legendName)