public class BoxPlot extends XYPlot
Class that displays data as a box-and-whisker plot showing summaries of
important statistical values. The data source must provide six columns to
the BoxPlot
:
The utility method createBoxData(DataSource)
can be used to
obtain common statistics for these properties from the each column of an
existing data source.
To create a new BoxPlot
simply create a new instance using
a data source. Example:
DataTable data = new DataTable(Double.class, Double.class); data.add(10.98, -12.34); data.add( 7.65, 45.67); data.add(43.21, 89.01); DataSource boxData = BoxPlot.createBoxData(data); BoxPlot plot = new BoxPlot(boxData);
Modifier and Type | Class and Description |
---|---|
static class |
BoxPlot.BoxPlotLegend
A legend implementation for box-and-whisker plots that displays all
values of the data source as items.
|
static class |
BoxPlot.BoxWhiskerRenderer
Class that renders a box and its whiskers in a box-and-whisker plot.
|
XYPlot.XYLegend, XYPlot.XYNavigationDirection, XYPlot.XYPlotArea2D, XYPlot.XYPlotNavigator
Constructor and Description |
---|
BoxPlot(DataSource data)
Initializes a new box-and-whisker plot with the specified data source.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
DataSource source,
boolean visible)
Inserts the specified data series to the plot at a specified position.
|
void |
autoscaleAxis(java.lang.String axisName)
Tries to automatically set the ranges of the axes specified by the name
if it is set to auto-scale.
|
static DataSource |
createBoxData(DataSource data)
Extracts statistics from the columns of an data source that are commonly
used for box-and-whisker plots.
|
createDefaultAxes, createDefaultAxisRenderers, draw, getAreaRenderer, getLineRenderer, getNavigator, getPointRenderer, layoutAxes, rangeChanged, setAreaRenderer, setAxisRenderer, setLineRenderer, setPointRenderer
add, add, autoscaleAxes, clear, contains, dataAdded, dataChanged, dataRemoved, dataUpdated, drawAxes, drawLegend, get, getAxesNames, getAxis, getAxisComponent, getAxisMax, getAxisMin, getAxisRenderer, getBackground, getBorderColor, getBorderStroke, getData, getLegend, getLegendContainer, getLegendDistance, getLegendLocation, getMapping, getPlotArea, getTitle, getVisibleData, isLegendVisible, isVisible, layout, layoutLegend, refreshLegendLayout, remove, removeAxis, setAxis, setBackground, setBorderColor, setBorderStroke, setLegend, setLegendDistance, setLegendLocation, setLegendVisible, setMapping, setPlotArea, setVisible
add, add, drawComponents, getConstraints, getDrawableAt, getInsets, getLayout, getPreferredSize, iterator, remove, setBounds, setBounds, setInsets, setLayout, size
getBounds, getHeight, getWidth, getX, getY
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBounds, getHeight, getPreferredSize, getWidth, getX, getY, setBounds, setBounds
public BoxPlot(DataSource data)
data
- Data to be displayed.public static DataSource createBoxData(DataSource data)
data
- Original data sourcepublic void add(int index, DataSource source, boolean visible)
AbstractPlot
public void autoscaleAxis(java.lang.String axisName)
AbstractPlot
autoscaleAxis
in interface Plot
autoscaleAxis
in class AbstractPlot
axisName
- Name of the axis that should be scaled.Axis.setAutoscaled(boolean)