public class BarPlot extends XYPlot
Class that displays data in a bar plot.
To create a new BarPlot
simply create a new instance
using one or more data sources. Example:
DataTable data = new DataTable(Integer.class, Double.class); data.add(2010, -5.00); data.add(2011, 3.25); data.add(2012, -0.50); data.add(2012, 4.00); BarPlot plot = new BarPlot(data);
Modifier and Type | Class and Description |
---|---|
static class |
BarPlot.BarPlotLegend
A legend implementation for bar plots that displays all values of the
data source as items.
|
static class |
BarPlot.BarRenderer
Class that renders a bar in a bar plot.
|
XYPlot.XYLegend, XYPlot.XYNavigationDirection, XYPlot.XYPlotArea2D, XYPlot.XYPlotNavigator
Modifier and Type | Field and Description |
---|---|
static Key |
BAR_HEIGHT_MIN
Key for specifying a
Number value for the minimum height of the
bars in view units (e.g. pixels on screen). |
static Key |
BAR_WIDTH
Key for specifying a
Number value for the width of the bars in
axis coordinates. |
static Key |
PAINT_ALL_BARS
Key for specifying a
Boolean value which defines whether
painting should happen over all bars at once, otherwise each bar will be
filled independently. |
BACKGROUND, BORDER, COLOR, LEGEND, LEGEND_DISTANCE, LEGEND_LOCATION, TITLE, TITLE_FONT
Constructor and Description |
---|
BarPlot(DataSource... data)
Creates a new instance and initializes it with the specified
data sources.
|
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(String axisName)
Tries to automatically set the ranges of the axes specified by the name
if it is set to auto-scale.
|
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, getData, getLegend, getLegendContainer, getMapping, getPlotArea, getTitle, getVisibleData, isVisible, layout, layoutLegend, remove, removeAxis, setAxis, setLegend, setMapping, setPlotArea, settingChanged, setVisible
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
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
add, add, getBounds, getConstraints, getDrawableAt, getInsets, getLayout, remove, setBounds, setInsets, setLayout, size
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
public static final Key BAR_WIDTH
Number
value for the width of the bars in
axis coordinates.public static final Key BAR_HEIGHT_MIN
Number
value for the minimum height of the
bars in view units (e.g. pixels on screen).public BarPlot(DataSource... data)
data
- Data to be displayed.public void autoscaleAxis(String axisName)
AbstractPlot
autoscaleAxis
in interface Plot
autoscaleAxis
in class AbstractPlot
axisName
- Name of the axis that should be scaled.Axis.setAutoscaled(boolean)
public void add(int index, DataSource source, boolean visible)
AbstractPlot
Copyright © 2009-2013. All Rights Reserved.