com.objectplanet.chart
Class BarChart

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.objectplanet.chart.GenericChart
                  extended by com.objectplanet.chart.Chart
                      extended by com.objectplanet.chart.BarChart
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable

public class BarChart
extends Chart

This bar chart component enables you to add a bar chart to your java applications with just a few lines of code.

A simple bar chart can be created with the following code:

 BarChart chart = new BarChart(5);
 long[] values = new long[] {100, 200, 300, 400, 500};
 chart.setSampleValues(values);
A chart with the legend turned on, multicolor set, and displayed in 3D can be created with the following code:
 BarChart chart = new BarChart(5);
 long[] values = new long[] {100, 200, 300, 400, 500};
 chart.setSampleValues(values);
 chart.setMultiColorOn(true);
 chart.setLegendOn(true);
 chart.set3DModeOn(true);

See here for a list of parameters to set for the bar chart.

Author:
Bjorn J. Kvande.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int BEHIND_BARS
          Use bars behind each other in multiple series charts; setBarType()
static int BLOCK
           
static int CYLINDER
           
static int SIDE_BY_SIDE_BARS
          Use side-by-side bars in multiple series charts; setBarType()
static int STACKED_BARS
          Use stacked bars in multiple series charts; setBarType()
 
Fields inherited from class com.objectplanet.chart.Chart
BELOW, BELOW_AND_FLOATING, BOTTOM, chartData, FLOATING, HORIZONTAL, INSIDE, LEFT, OUTSIDE, POINTING, RIGHT, TARGET_LINE_ID_AND_VALUE_LABEL, TARGET_LINE_ID_LABEL, TARGET_LINE_NO_LABEL, TARGET_LINE_VALUE_LABEL, TOP, VERTICAL, visibleSamples
 
Fields inherited from class com.objectplanet.chart.GenericChart
chartType, DEFAULT_SAMPLE_COLORS, depth3dPoint, display3dOn, displayVersionOn, dragged_label, grid, gridRenderer, legend, legendRenderer, legendSelection, needChartCalculation, needGraphBounds, needRender, new_cursor, old_cursor, overlayCharts, renderer
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BarChart()
          Creates a bar chart with 1 series, 1 sample and a range of 100.
BarChart(int count)
          Creates a bar chart with the given number of samples and default range.
BarChart(int count, double range)
          Creates a bar chart with the given number of bars and range.
BarChart(int sampleCount, double range, double lowerRange)
          Creates a bar chart with the given number of bars and range.
BarChart(int seriesCount, int sampleCount, double range, double lowerRange)
          Creates a bar chart with the given number of series and bars and range.
 
Method Summary
protected  void checkDataIntegrity()
          Makes sure the barchart specific data has the same number of series and samples as the chart data has.
 ChartSample checkSelection(java.awt.Point point)
          This method is called when the user releases the mouse and checks if the given point is inside a bar or a legend label.
 java.awt.Rectangle getBarBounds(int serie, int sample)
          Gets the bounds of the specified bar.
 java.awt.Color getBarLabelColor(int index)
          Gets the color of the bar label of the specified sample.
 java.lang.String[] getBarLabels()
          Gets the bar labels.
 java.awt.Color getBarOutlineColor()
          Gets the color used for the bar outline.
 int getBarShape()
           
 int getBarType()
          Gets the current bar type in multiple series charts.
 double getBarWidth()
          Gets the relative width of each bar.
 int getGridAlignment()
          Gets the bar alignment.
protected  double getHighestValue(int range)
          Gets the highest value in the chart larger than 0.
 java.lang.String[] getLegendLabels()
          Gets the legend labels.
protected  double getLowestValue(int range)
          Gets the value of the deepest bar, stacked or not.
 int getValuePosition(double value)
          Gets the position in the chart of the specified value.
 boolean isAutoLabelSpacingOn()
          Gets the state of the automatic label spacing.
 boolean isBarLabelsOn()
          Checks if the bar labels are turned on.
 boolean isBarOutlineOn()
          Checks if the bar outline is turned on or off.
 boolean isMultiColorOn()
          Checks if the multicolor mode is turned on.
 boolean isMultiSeriesOn()
          Checks if the chart is in multi series mode.
 void reset()
          Resets the chart data and features.
 void setAutoLabelSpacingOn(boolean on)
          Turns on or off automatic bar label spacing.
 void setBarAlignment(int alignment)
          Sets the bar alignment.
 void setBarLabelColor(int index, java.awt.Color color)
          Sets the color of of the bar label for the specified sample.
 void setBarLabels(java.lang.String[] labels)
          Sets the bar labels.
 void setBarLabelsOn(boolean on)
          Turns on or off the bar labels.
 void setBarOutlineColor(java.awt.Color color)
          Sets the color used for the bar outline.
 void setBarOutlineOn(boolean on)
          Turns on or off the bar outline.
 void setBarShape(int shape)
           
 void setBarType(int type)
          Sets the bar type in multiple series charts.
 void setBarWidth(double width)
          Sets the relative width of each bar.
 void setMultiColorOn(boolean on)
          Turns on or off multi-color bar display.
 void setMultiSeriesOn(boolean state)
          Makes the chart behave like it does when it has multiple data series, even if it has only one.
 
Methods inherited from class com.objectplanet.chart.Chart
addItemListener, appendSample, appendSampleLabel, appendSampleValue, calculateChartData, constructLabel, displayFloatingLabel, formatRangeNumber, formatSeriesNumber, get3DDepth, getAngledLabelCache, getChartData, getCurrentLowerRange, getCurrentRange, getDataBounds, getGridLine, getGridLineColor, getGridLineColors, getGridLines, getLabelSize, getLastSelectedSample, getLastSelectedSeries, getLegendColor, getLowerRange, getMaxValue, getMaxValueLineCount, getMinValue, getRange, getRangeAdjusted, getRangeAdjusterPosition, getRangeColor, getRangeCount, getRangeDecimalCount, getRangeFormatter, getRangeInterval, getRangePosition, getSample, getSample, getSampleColor, getSampleColor2, getSampleColors, getSampleColors2, getSampleCount, getSampleDecimalCount, getSampleLabel, getSampleLabelColor, getSampleLabels, getSampleLabelSelectionColor, getSampleLabelStyle, getSamples, getSampleValue, getSampleValues, getSelectedObjects, getSeriesCount, getSeriesFormatter, getSeriesLabel, getSeriesLabelColor, getSeriesLabels, getSeriesLabelStyle, getSeriesRange, getStringValues, getTargetLabelsPosition, getTargetValueLine, getValueLabelColor, getValueLabelStyle, getValueLinesColor, getVisibleSamples, hasDataChangedSince, hashCode, isDefaultGridLinesOn, isGridAdjustmentOn, isLegendBoxSizeAsFont, isRangeAdjusterOn, isRangeLabelsOn, isRangeOn, isSampleLabelsOn, isSampleScrollerOn, isSelected, isSeriesEmpty, isSeriesLabelsOn, isValueLabelsOn, isValueLabelsOn, isValueLinesOn, main, paintGrid, processEvent, removeItemListener, renderData, set3DDepth, setChartData, setCurrentLowerRange, setCurrentRange, setDefaultGridLinesColor, setDefaultGridLinesOn, setDefaultGridLinesOn, setGridAdjustmentOn, setGridLine, setGridLineColor, setGridLineColors, setGridLines, setGridLinesColor, setLegendBoxSizeAsFont, setLowerRange, setLowerRelativeRange, setLowerRelativeRange, setLowerRelativeRange, setMaxValueLineCount, setRange, setRangeAdjusted, setRangeAdjusterOn, setRangeAdjusterPosition, setRangeColor, setRangeDecimalCount, setRangeFormatter, setRangeInterval, setRangeLabelsOn, setRangeOn, setRangePosition, setRelativeRange, setRelativeRange, setRelativeRange, setSample, setSampleAxisRange, setSampleColor, setSampleColor2, setSampleColors, setSampleColors2, setSampleCount, setSampleDecimalCount, setSampleLabel, setSampleLabelColor, setSampleLabels, setSampleLabelSelectionColor, setSampleLabelsOn, setSampleLabelStyle, setSamples, setSampleScrollerOn, setSampleValue, setSampleValues, setSelection, setSelection, setSelection, setSeriesCount, setSeriesFormatter, setSeriesLabel, setSeriesLabelColor, setSeriesLabels, setSeriesLabelsOn, setSeriesLabelStyle, setSeriesRange, setTargetLabelsPosition, setTargetValueLine, setTargetValueLine, setValueLabelColor, setValueLabelsOn, setValueLabelsOn, setValueLabelStyle, setValueLinesColor, setValueLinesOn, setVisibleSamples, setVisibleSamples
 
Methods inherited from class com.objectplanet.chart.GenericChart
addImage, addOverlayChart, autoRepaint, clearAngledLabelCache, createImage_oldstyle, createImage, forceRepaint, formatNumber, getAlternateChartBackground, getBackground2, getChartBackground, getChartBackground2, getChartForeground, getFont, getGraphBounds, getGraphInsets, getGridImage, getImage, getImage, getLabel, getLabelAngle, getLabelAtPoint, getLabelBounds, getLabelColor, getLabelPosition, getLegendColors, getLegendColumns, getLegendImage, getLegendPosition, getLocale, getMinimumSize, getOverlayChart, getOverlayInsets, getPreferredSize, getSize, getThousandsDelimeter, getTitle, getTotalGraphBounds, getVersion, handleCustomLabels, is3DModeOn, isAntialiasingOn, isAutomaticRepaintOn, isFloatingOnLegendOn, isGridOutline3DOn, isLegendOn, isLegendReverseOn, isOverlayChartOn, isPrintAsBitmap, isSampleHighlightOn, isServletModeOn, isTitleOn, isZoomOn, loadImage, paint, print, removeExternalGraphics, removeOverlayChart, render, render, renderOffScreen, set3DModeOn, setAlternateChartBackground, setAntialiasingOn, setAutomaticRepaintOn, setBackground, setBackground2, setChartBackground, setChartBackground2, setChartForeground, setExternalGraphics, setFloatingOnLegendOn, setFont, setForeground, setGraphInsets, setGridImage, setGridOutline3DOn, setLabel, setLabel, setLabel, setLabel, setLabel, setLabelAngle, setLabelAngleCacheSize, setLabelColor, setLabelPosition, setLabelPosition, setLabelURL, setLegendColor, setLegendColors, setLegendColumns, setLegendImage, setLegendLabels, setLegendOn, setLegendPosition, setLegendReverseOn, setLocale, setNeedChartCalculation, setOverlayChart, setOverlayChartOn, setOverlayInsets, setPreferredSize, setPrintAsBitmap, setServletModeOn, setThousandsDelimiter, setTitle, setTitleOn, setZoomOn, toString, update
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BEHIND_BARS

public static final int BEHIND_BARS
Use bars behind each other in multiple series charts; setBarType()

See Also:
Constant Field Values

BLOCK

public static final int BLOCK
See Also:
Constant Field Values

CYLINDER

public static final int CYLINDER
See Also:
Constant Field Values

SIDE_BY_SIDE_BARS

public static final int SIDE_BY_SIDE_BARS
Use side-by-side bars in multiple series charts; setBarType()

See Also:
Constant Field Values

STACKED_BARS

public static final int STACKED_BARS
Use stacked bars in multiple series charts; setBarType()

See Also:
Constant Field Values
Constructor Detail

BarChart

public BarChart()
Creates a bar chart with 1 series, 1 sample and a range of 100.


BarChart

public BarChart(int count)
Creates a bar chart with the given number of samples and default range. The default range is 100.

Parameters:
count - The number of bars for the chart.

BarChart

public BarChart(int count,
                double range)
Creates a bar chart with the given number of bars and range.

Parameters:
count - The number of bars for the chart.
range - The initial range of the chart.

BarChart

public BarChart(int sampleCount,
                double range,
                double lowerRange)
Creates a bar chart with the given number of bars and range.

Parameters:
sampleCount - The number of bars for the chart.
range - The initial upper range of the chart.
lowerRange - The initial lower range of the chart.

BarChart

public BarChart(int seriesCount,
                int sampleCount,
                double range,
                double lowerRange)
Creates a bar chart with the given number of series and bars and range.

Parameters:
seriesCount - The number of data series in the chart.
sampleCount - The number of sample in the chart.
range - The initial upper range of the chart.
lowerRange - The initial lower range of the chart.
Method Detail

checkDataIntegrity

protected void checkDataIntegrity()
Makes sure the barchart specific data has the same number of series and samples as the chart data has.

Overrides:
checkDataIntegrity in class Chart

checkSelection

public ChartSample checkSelection(java.awt.Point point)
This method is called when the user releases the mouse and checks if the given point is inside a bar or a legend label.

Overrides:
checkSelection in class Chart
Parameters:
point - The point clicked on.
Returns:
The bar selected, or null if no bar was selected.

getBarBounds

public java.awt.Rectangle getBarBounds(int serie,
                                       int sample)
Gets the bounds of the specified bar.

Parameters:
serie - The series index
sample - The sample index.
Returns:
The bounds of the bar.

getBarLabelColor

public java.awt.Color getBarLabelColor(int index)
Gets the color of the bar label of the specified sample.

Parameters:
index - The index of the sample (0-based).
Returns:
The color, or null if default or sampleColor used.
Throws:
java.lang.IllegalArgumentException - if the sample index is invalid.

getBarLabels

public java.lang.String[] getBarLabels()
Gets the bar labels. The array returned is the original, so don't change anything in it if you don't know what you are doing.

Returns:
An array with the labels.

getBarOutlineColor

public java.awt.Color getBarOutlineColor()
Gets the color used for the bar outline.

Returns:
Color of the bar outline.

getBarShape

public int getBarShape()

getBarType

public int getBarType()
Gets the current bar type in multiple series charts.

Returns:
STACKED_BARS, SIDE_BY_SIDE_BARS or BEHIND_BARS.

getBarWidth

public double getBarWidth()
Gets the relative width of each bar.

Returns:
The width as a fraction between 0.0 and 1.0.
See Also:
setBarWidth(double)

getGridAlignment

public int getGridAlignment()
Gets the bar alignment.

Returns:
HORIZONTAL or VERTICAL.
See Also:
setBarAlignment(int)

getHighestValue

protected double getHighestValue(int range)
Gets the highest value in the chart larger than 0.

Overrides:
getHighestValue in class Chart
Parameters:
range - The index of the range (0 or 1).
Returns:
The highest value or 0 if none are larger than 0.

getLegendLabels

public java.lang.String[] getLegendLabels()
Gets the legend labels. The array returned is the original, so don't change anything in it if you don't know what you are doing.

Overrides:
getLegendLabels in class Chart
Returns:
An array with the labels.
See Also:
GenericChart.setLegendLabels(java.lang.String[])

getLowestValue

protected double getLowestValue(int range)
Gets the value of the deepest bar, stacked or not.

Overrides:
getLowestValue in class Chart
Parameters:
range - The index of the range (0 or 1).

getValuePosition

public int getValuePosition(double value)
Gets the position in the chart of the specified value. If the alignment of the bars is VERTICAL the position represents the y-axis. If the alignment of the bars is HORIZONTAL the position represents the x-axis.

Parameters:
value - The value to find the position for.
Returns:
The pixel position.

isAutoLabelSpacingOn

public boolean isAutoLabelSpacingOn()
Gets the state of the automatic label spacing.

Returns:
True for on, false for off.
See Also:
setAutoLabelSpacingOn(boolean)

isBarLabelsOn

public boolean isBarLabelsOn()
Checks if the bar labels are turned on.

Returns:
True for on, false for off.

isBarOutlineOn

public boolean isBarOutlineOn()
Checks if the bar outline is turned on or off. The bar outline is the frame drawn around each bar.

Returns:
True if on, false for off.

isMultiColorOn

public boolean isMultiColorOn()
Checks if the multicolor mode is turned on.

Returns:
True if multicolor, false otherwise.

isMultiSeriesOn

public boolean isMultiSeriesOn()
Checks if the chart is in multi series mode.

Overrides:
isMultiSeriesOn in class GenericChart
Returns:
True for multi series, false otherwise.
See Also:
setMultiSeriesOn(boolean)

reset

public void reset()
Resets the chart data and features.

Overrides:
reset in class Chart

setAutoLabelSpacingOn

public void setAutoLabelSpacingOn(boolean on)
Turns on or off automatic bar label spacing. If this is on, only bar labels there is space for will be painted. If turned off, all labels will be painted, even if they overlap. It is turned off by default.

Parameters:
on - True for on, false for off.

setBarAlignment

public void setBarAlignment(int alignment)
Sets the bar alignment. The default alignment is vertical.

Parameters:
alignment - HORIZONTAL or VERTICAL.
Throws:
java.lang.IllegalArgumentException - If the alignment is not valid.

setBarLabelColor

public void setBarLabelColor(int index,
                             java.awt.Color color)
Sets the color of of the bar label for the specified sample. Bar label colors override sample label colors.

Parameters:
index - The index of the sample (0-based).
color - The color to use, null for the samleColors color.
Throws:
java.lang.IllegalArgumentException - if the sample index is invalid.

setBarLabels

public void setBarLabels(java.lang.String[] labels)
Sets the bar labels. Bar labels are shown painted below the grid.

Parameters:
labels - The labels, or null for default behavior.
See Also:
setBarLabelsOn(boolean), Chart.setSampleLabels(java.lang.String[])

setBarLabelsOn

public void setBarLabelsOn(boolean on)
Turns on or off the bar labels. If there are sample labels below the grid, the bar labels override them.

Parameters:
on - True if the bar labels should be displayed.
See Also:
Chart.setSampleLabel(int, java.lang.String)

setBarOutlineColor

public void setBarOutlineColor(java.awt.Color color)
Sets the color used for the bar outline. If color is null, chart foreground is used

Parameters:
color - The color to set.

setBarOutlineOn

public void setBarOutlineOn(boolean on)
Turns on or off the bar outline. The bar outline is the frame drawn around each bar. The bar outline is turned on by default.

Parameters:
on - True if on, false for off.

setBarShape

public void setBarShape(int shape)

setBarType

public void setBarType(int type)
Sets the bar type in multiple series charts.

Parameters:
type - STACKED_BARS, SIDE_BY_SIDE_BARS or BEHIND_BARS.
Throws:
java.lang.IllegalArgumentException - If the type is not valid.

setBarWidth

public void setBarWidth(double width)
Sets the relative width of each bar. If the width is set to 1.0, there will be no space between the bars. If the width is set to 0.5, the space between each bar will be the same as the width of the bar. If you have side-by-side bars in the chart, it is the combined width of a sample that is set.

Parameters:
width - The width fraction to use (0.0 to 1.0).

setMultiColorOn

public void setMultiColorOn(boolean on)
Turns on or off multi-color bar display.

Parameters:
on - True for multi-color, false for single-color.

setMultiSeriesOn

public void setMultiSeriesOn(boolean state)
Makes the chart behave like it does when it has multiple data series, even if it has only one. The labels in the chart will then always be the series labels, and not change to the sample labels when the number of data series changes to one.

Overrides:
setMultiSeriesOn in class GenericChart
Parameters:
state - True for on, false for off.