public interface ChartFactory
This is open source software released under the Apache 2.0 License
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSupported(Chart<?> chart)
Returns true if this factory supports the chart type specified
|
String |
javascript(Chart<?>... charts)
Returns Javascript to embed in an HTML page which will plot the charts specified.
|
String |
javascript(Iterable<Chart<?>> charts)
Returns Javascript to embed in an HTML page which will plot the charts specified.
|
<X extends Comparable,S extends Comparable> |
ofPiePlot(boolean is3d,
Consumer<Chart<PiePlot<X,S>>> configurator)
Returns a newly created Pie chart and applies it to the configurator provided
|
<X extends Comparable> |
ofXY(Class<X> domainType,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created XY chart and applies it to the configurator provided
|
void |
show(int columns,
Iterable<Chart<?>> charts)
Displays the collection of charts in a grid with the number of columns specified
|
void |
show(int columns,
Stream<Chart<?>> charts)
Displays the collection of charts in a grid with the number of columns specified
|
default <R extends Comparable,C extends Comparable> |
withAcf(com.zavtech.morpheus.frame.DataFrameLeastSquares<R,C> model,
int maxLags,
double alpha,
Consumer<Chart<XyPlot<Integer>>> consumer)
Generates a plot of the Autocorrelation function (ACF) given the Least Squares model
|
default <X extends Comparable,S extends Comparable> |
withAreaPlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame,
boolean stacked,
S domainKey,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created area chart using a column for the domain axis
|
default <X extends Comparable,S extends Comparable> |
withAreaPlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame,
boolean stacked,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created area chart using the row keys for the domain axis
|
default <X extends Comparable,S extends Comparable> |
withBarPlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame,
boolean stacked,
S domainKey,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created Bar Chart using a column to build the domain axis
|
default <X extends Comparable,S extends Comparable> |
withBarPlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame,
boolean stacked,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created Bar Chart using the row keys to build the domain axis
|
default <R,C extends Comparable> |
withHistPlot(com.zavtech.morpheus.frame.DataFrame<R,C> frame,
int binCount,
boolean sharedBins,
Consumer<Chart<XyPlot<Double>>> configurator)
Returns a Chart to plot a histogram based on the column data in the frame provided
|
default <R,C extends Comparable> |
withHistPlot(com.zavtech.morpheus.frame.DataFrame<R,C> frame,
int binCount,
C columnKey,
Consumer<Chart<XyPlot<Double>>> configurator)
Returns a Histogram Bar Chart of the frequency distribution for a specific column in a DataFrame
|
default <R,C extends Comparable> |
withHistPlot(com.zavtech.morpheus.frame.DataFrame<R,C> frame,
int binCount,
Consumer<Chart<XyPlot<Double>>> configurator)
Returns a Histogram Bar Chart of the frequency distribution for a all columns in a DataFrame
|
default <X extends Comparable,S extends Comparable> |
withLinePlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame,
S domainKey,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created Line Chart using a column for the domain axis
|
default <X extends Comparable,S extends Comparable> |
withLinePlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created Line Chart using the row keys for the domain axis
|
default <X extends Comparable,S extends Comparable> |
withPiePlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame,
boolean is3d,
S dataKey,
S labelKey,
Consumer<Chart<PiePlot<X,S>>> configurator)
Returns a newly created Pie Chart using labels from the column identified by labelKey and the values from the column labelled dataKey
|
default <X extends Comparable,S extends Comparable> |
withPiePlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame,
boolean is3d,
Consumer<Chart<PiePlot<X,S>>> configurator)
Returns a newly created Pie Chart using the row keys for labels and the first numeric column for values
|
default <X extends Comparable,S extends Comparable> |
withPiePlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame,
boolean is3d,
S dataKey,
Consumer<Chart<PiePlot<X,S>>> configurator)
Returns a newly created Pie Chart using the row keys for labels and the values from the column labelled dataKey
|
default <R extends Comparable,C extends Comparable> |
withResidualsVsFitted(com.zavtech.morpheus.frame.DataFrameLeastSquares<R,C> model,
Consumer<Chart<XyPlot<Double>>> consumer)
Returns a chart that plots regression residuals against the fitted values in a regression
|
default <X extends Comparable,S extends Comparable> |
withScatterPlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame,
boolean shapes,
S domainKey,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created scatter chart with shapes using a column for the domain axis
|
default <X extends Comparable,S extends Comparable> |
withScatterPlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame,
boolean shapes,
Consumer<Chart<XyPlot<X>>> configurator)
Returns a newly created scatter chart with shapes using the row keys for the domain axis
|
boolean isSupported(Chart<?> chart)
chart - the chart instancevoid show(int columns,
Iterable<Chart<?>> charts)
columns - the number of columns for chart gridcharts - the sequence of charts to plotvoid show(int columns,
Stream<Chart<?>> charts)
columns - the number of columns for chart gridcharts - the sequence of charts to plotString javascript(Chart<?>... charts)
div elements which
have attributes labelled "chart_N" where N is 0, 1, 2, N. The first chart
in the arguments will be plotted in div with id=chart_0, the second will be plotted in the
div with id=chart_1 and so on. charts - the sequence of charts to generate Javascript fromString javascript(Iterable<Chart<?>> charts)
div elements which
have attributes labelled "chart_N" where N is 0, 1, 2, N. The first chart
in the arguments will be plotted in div with id=chart_0, the second will be plotted in the
div with id=chart_1 and so on. charts - the sequence of charts to generate Javascript from<X extends Comparable> Chart<XyPlot<X>> ofXY(Class<X> domainType, Consumer<Chart<XyPlot<X>>> configurator)
X - the domain key typeconfigurator - the chart configuratordomainType - the data type for the domain axis<X extends Comparable,S extends Comparable> Chart<PiePlot<X,S>> ofPiePlot(boolean is3d, Consumer<Chart<PiePlot<X,S>>> configurator)
X - the item key typeis3d - true for a 3d plotconfigurator - the chart configuratordefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withLinePlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withLinePlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame, S domainKey, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartdomainKey - the column key in the frame that defines the domainconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withAreaPlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame, boolean stacked, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartstacked - true to generate a stacked area plot, false for overlappingconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withAreaPlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame, boolean stacked, S domainKey, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartstacked - true to generate a stacked area plot, false for overlappingdomainKey - the column key in the frame that defines the domainconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withScatterPlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame, boolean shapes, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartshapes - true for series specific shapesconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withScatterPlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame, boolean shapes, S domainKey, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartshapes - true for series specific shapesdomainKey - the column key in the frame that defines the domainconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withBarPlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame, boolean stacked, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartstacked - true to generate a stacked bar plot, false for non-statckedconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<XyPlot<X>> withBarPlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame, boolean stacked, S domainKey, Consumer<Chart<XyPlot<X>>> configurator)
frame - the DataFrame for the chartstacked - true to generate a stacked bar plot, false for non-statckeddomainKey - the column key in the frame that defines the domainconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<PiePlot<X,S>> withPiePlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame, boolean is3d, Consumer<Chart<PiePlot<X,S>>> configurator)
X - the frame row axis typeS - the frame column axis typeframe - the DataFrame for the chartis3d - true for 3D PiePlotconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<PiePlot<X,S>> withPiePlot(com.zavtech.morpheus.frame.DataFrame<X,S> frame, boolean is3d, S dataKey, Consumer<Chart<PiePlot<X,S>>> configurator)
X - the frame row axis typeS - the frame column axis typeframe - the DataFrame containing datais3d - true for 3D PiePlotdataKey - the column key to use for data valuesconfigurator - the configurator to accept config to the chartdefault <X extends Comparable,S extends Comparable> Chart<PiePlot<X,S>> withPiePlot(com.zavtech.morpheus.frame.DataFrame<?,S> frame, boolean is3d, S dataKey, S labelKey, Consumer<Chart<PiePlot<X,S>>> configurator)
X - the frame row axis typeS - the frame column axis typeframe - the DataFrame containing datais3d - true for 3D PiePlotdataKey - the column key to use for data valueslabelKey - the column key to use for labelsconfigurator - the configurator to accept config to the chartdefault <R,C extends Comparable> Chart<XyPlot<Double>> withHistPlot(com.zavtech.morpheus.frame.DataFrame<R,C> frame, int binCount, Consumer<Chart<XyPlot<Double>>> configurator)
C - the series key type for frameframe - the data from which to generate a histogram for each columnbinCount - the number of bins to include in the histogramconfigurator - the optional consumer to configure the chartdefault <R,C extends Comparable> Chart<XyPlot<Double>> withHistPlot(com.zavtech.morpheus.frame.DataFrame<R,C> frame, int binCount, boolean sharedBins, Consumer<Chart<XyPlot<Double>>> configurator)
C - the column key type for frameframe - the data from which to generate a histogram for each columnbinCount - the number of bins to include in the histogramsharedBins - if true and the frame has multiple columns, each series will share the same width bin rather than being computed independentlyconfigurator - the optional consumer to configure the chartdefault <R,C extends Comparable> Chart<XyPlot<Double>> withHistPlot(com.zavtech.morpheus.frame.DataFrame<R,C> frame, int binCount, C columnKey, Consumer<Chart<XyPlot<Double>>> configurator)
C - the column key type for frameframe - the DataFrame of data to generate a histogram forbinCount - the number of bins to include in the histogramcolumnKey - the key of the column to generate the histogram forconfigurator - the optional consumer to configure the chartdefault <R extends Comparable,C extends Comparable> Chart<XyPlot<Integer>> withAcf(com.zavtech.morpheus.frame.DataFrameLeastSquares<R,C> model, int maxLags, double alpha, Consumer<Chart<XyPlot<Integer>>> consumer)
R - the row key typeC - the column key typemodel - the least squares modelmaxLags - the max lags for ACF plotalpha - the significance level for confidence intervals (e.g. 0.05 implies 5% level, or 95% confidence interval)consumer - the consumer to configure additional options on the chartdefault <R extends Comparable,C extends Comparable> Chart<XyPlot<Double>> withResidualsVsFitted(com.zavtech.morpheus.frame.DataFrameLeastSquares<R,C> model, Consumer<Chart<XyPlot<Double>>> consumer)
R - the row key typeC - the column key typemodel - the least squares modelconsumer - the user provide chart configuratorCopyright 2014-2017, Xavier Witdouck