com.objectplanet.chart
Class LineChart

java.lang.Object
  |
  +--java.awt.Component
        |
        +--com.objectplanet.chart.Chart
              |
              +--com.objectplanet.chart.LineChart
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class LineChart
extends Chart

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

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

 LineChart chart = new LineChart();
 long[] values = new long[] {20, 10, 30, 50, 40};
 chart.setSampleValues(values);
A chart with several data series can be created with the following code:
 LineChart chart = new LineChart(4, 10, 100);
 long[] series0 = new long[] {98,23,46,89,72,36,49,87,23,64};
 long[] series1 = new long[] {80,17,92,63,98,16,53,86,52,34};
 long[] series2 = new long[] {29,83,46,93,80,72,36,42,98,36};
 long[] series3 = new long[] {45,86,90,86,54,65,98,75,44,54};
 chart.setSampleValues(0, series0);
 chart.setSampleValues(1, series1);
 chart.setSampleValues(2, series2);
 chart.setSampleValues(3, series3);

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

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

Nested Class Summary
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int SAMPLE_HIGHLIGHT_CIRCLE
          Use a circle as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_CIRCLE_FILLED
          Use a filled circle as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_CIRCLE_OPAQUE
          Use an opaque circle as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_DIAMOND
          Use a diamond as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_DIAMOND_FILLED
          Use a filled diamond as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_DIAMOND_OPAQUE
          Use an opaque diamond as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_SQUARE
          Use a square as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_SQUARE_FILLED
          Use a filled square as a sample highlighter on a line.
static int SAMPLE_HIGHLIGHT_SQUARE_OPAQUE
          Use an opaque square as a sample highlighter on a line.
 
Fields inherited from class com.objectplanet.chart.Chart
BELOW, BELOW_AND_FLOATING, BOTTOM, chartData, FLOATING, HORIZONTAL, INSIDE, LEFT, OUTSIDE, overlayCharts, RIGHT, STATIC, 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 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
LineChart()
          Creates a line chart with one series, 5 samples, and a range of 0-100.
LineChart(int seriesCount, int sampleCount, double range)
          Creates a line chart with the specified number of series, the number of samples per serie, and the chart range.
LineChart(int seriesCount, int sampleCount, double range, double lowerRange)
          Creates a line chart with the specified number of series, the number of samples per serie, and the chart range.
 
Method Summary
protected  void calculateChartData(java.awt.Rectangle grid, java.awt.Rectangle dataBounds)
          Calculates chart data.
protected  void checkDataIntegrity()
          Makes sure the linechart specific data has the same number of series and samples as the chart data has.
 com.objectplanet.chart.ChartSample checkSelection(java.awt.Point point)
          If we select a box in the legend, it returns a ChartSample with the correct series, but the sample is set to -1.
 java.awt.Rectangle getGraphBounds()
          Calculates the bounding rectangle of the graph itself, based on which features are on and how they are configured.
 java.lang.String[] getLegendLabels()
          Gets the legend labels.
 int getLineWidth(int series)
          Gets the current width of the given series line.
 double getMaxValue(int serie)
          Gets the maximum value in the chart.
 int getSampleHighlightSize(int series)
          Gets the sample highlight size.
 int getSampleHighlightStyle(int series)
          Gets the sample highlight style.
 int getValueLabelStyle()
          Gets the value label style.
 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 isConnectedLinesOn(int serie)
          Checks if lines with missing values are connected.
 boolean isRightToLeftScrollingOn()
          Checks if the right to left scrolling is turned on.
 boolean isSampleHighlightOn(int series, int sample)
          Checks if the sample highlight is turned on or off for a sample.
 boolean isSeriesLineOn(int serie)
          Checks if the specified line is on.
 boolean isStackedOn()
          Checks if stacked lines are turned on.
 void render(java.awt.Graphics g)
          Renders the line chart according to the set attributes and the current features that are turned on.
protected  void renderData(java.awt.Graphics g, java.awt.Rectangle grid, java.awt.Rectangle dataBounds)
          Renders the lines for the chart.
 void reset()
          Resets the chart data and features.
 void setAutoLabelSpacingOn(boolean on)
          Turns on or off automatic sample label spacing.
 void setConnectedLinesOn(int serie, boolean on)
          Connects lines with missing values.
 void setLegendImage(int index, java.lang.String name)
          Sets an image to be used in front of the legend label and as the sample highlight for the specified series.
 void setLineWidth(int series, int width)
          Sets the width of the specified line.
 void setRightToLeftScrollingOn(boolean state)
          Turns on right to left scrolling when adding new values.
 void setSampleColors(java.awt.Color[] colors)
          Sets the sample colors.
 void setSampleHighlightOn(boolean on)
          Turns on or off the sample highlight for the data series.
 void setSampleHighlightOn(int series, boolean on)
          Turns on or off the sample highlight for a data series.
 void setSampleHighlightOn(int series, int sample, boolean on)
          Turns on or off the sample highlight for a sample in a data series.
 void setSampleHighlightStyle(int style, int size)
          Sets the sample highlight style for all the data series.
 void setSampleHighlightStyle(int serie, int style, int size)
          Sets the sample highlight style for the specified data series.
 void setSeriesLineOn(boolean state)
          Turns on or off the series lines.
 void setSeriesLineOn(int serie, boolean state)
          Turns on or off the specified series line.
 void setStackedOn(boolean on)
          Turns on or off stacked lines.
 void setValueLabelStyle(int style)
          Sets the value label style.
 
Methods inherited from class com.objectplanet.chart.Chart
addImage, addItemListener, addOverlayChart, appendSample, appendSampleLabel, appendSampleValue, autoRepaint, createImage, forceRepaint, formatNumber, get3DDepth, getChartBackground, getChartData, getChartForeground, getCurrentLowerRange, getCurrentRange, getDataBounds, getFont, getGraphInsets, getGridLine, getGridLineColor, getGridLineColors, getGridLines, getImage, getImage, getLabel, getLabelAngle, getLastSelectedSample, getLastSelectedSeries, getLegendColor, getLegendColors, getLegendImage, getLegendPosition, getLowerRange, getMaxValueLineCount, getMinimumSize, getMinValue, getOverlayChart, getPreferredSize, getRange, getRangeAdjusted, getRangeAdjusterPosition, getRangeColor, getRangeDecimalCount, getRangePosition, getSample, getSample, getSampleColor, getSampleColors, getSampleCount, getSampleDecimalCount, getSampleLabel, getSampleLabelColor, getSampleLabels, getSampleLabelSelectionColor, getSampleLabelStyle, getSamples, getSampleValue, getSampleValues, getSelectedObjects, getSeriesCount, getSeriesLabel, getSeriesLabelColor, getSeriesLabels, getSeriesLabelStyle, getSeriesRange, getSize, getTargetValueLine, getThousandsDelimeter, getTitle, getValueLinesColor, getVersion, is3DModeOn, isAutomaticRepaintOn, isDefaultGridLinesOn, isFloatingOnLegendOn, isGridAdjustmentOn, isLegendOn, isOverlayChartOn, isPrintAsBitmap, isRangeAdjusterOn, isRangeLabelsOn, isRangeOn, isSampleLabelsOn, isSampleScrollerOn, isSelected, isSeriesLabelsOn, isServletModeOn, isTitleOn, isValueLabelsOn, isValueLabelsOn, isValueLinesOn, loadImage, main, paint, print, processEvent, removeExternalGraphics, removeItemListener, removeOverlayChart, run, set3DDepth, set3DModeOn, setAutomaticRepaintOn, setBackground, setChartBackground, setChartData, setChartForeground, setCurrentLowerRange, setCurrentRange, setDefaultGridLinesColor, setDefaultGridLinesOn, setDefaultGridLinesOn, setExternalGraphics, setFloatingOnLegendOn, setFont, setForeground, setGraphInsets, setGridAdjustmentOn, setGridLine, setGridLineColor, setGridLineColors, setGridLines, setGridLinesColor, setLabel, setLabelAngle, setLabelAngleCacheSize, setLegendColor, setLegendColors, setLegendLabels, setLegendOn, setLegendPosition, setLowerRange, setLowerRelativeRange, setLowerRelativeRange, setLowerRelativeRange, setMaxValueLineCount, setOverlayChart, setOverlayChartOn, setPreferredSize, setPrintAsBitmap, setRange, setRangeAdjusted, setRangeAdjusterOn, setRangeAdjusterPosition, setRangeColor, setRangeDecimalCount, setRangeLabelsOn, setRangeOn, setRangePosition, setRelativeRange, setRelativeRange, setRelativeRange, setSample, setSampleAxisRange, setSampleColor, setSampleCount, setSampleDecimalCount, setSampleLabel, setSampleLabelColor, setSampleLabels, setSampleLabelSelectionColor, setSampleLabelsOn, setSampleLabelStyle, setSamples, setSampleScrollerOn, setSampleValue, setSampleValues, setSelection, setSelection, setSeriesCount, setSeriesLabel, setSeriesLabelColor, setSeriesLabels, setSeriesLabelsOn, setSeriesLabelStyle, setSeriesRange, setServletModeOn, setTargetValueLine, setThousandsDelimeter, setTitle, setTitleOn, setValueLabelsOn, setValueLabelsOn, setValueLinesColor, setValueLinesOn, setVisibleSamples, toString, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SAMPLE_HIGHLIGHT_CIRCLE

public static final int SAMPLE_HIGHLIGHT_CIRCLE
Use a circle as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_CIRCLE_FILLED

public static final int SAMPLE_HIGHLIGHT_CIRCLE_FILLED
Use a filled circle as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_CIRCLE_OPAQUE

public static final int SAMPLE_HIGHLIGHT_CIRCLE_OPAQUE
Use an opaque circle as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_DIAMOND

public static final int SAMPLE_HIGHLIGHT_DIAMOND
Use a diamond as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_DIAMOND_FILLED

public static final int SAMPLE_HIGHLIGHT_DIAMOND_FILLED
Use a filled diamond as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_DIAMOND_OPAQUE

public static final int SAMPLE_HIGHLIGHT_DIAMOND_OPAQUE
Use an opaque diamond as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_SQUARE

public static final int SAMPLE_HIGHLIGHT_SQUARE
Use a square as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_SQUARE_FILLED

public static final int SAMPLE_HIGHLIGHT_SQUARE_FILLED
Use a filled square as a sample highlighter on a line.

See Also:
Constant Field Values

SAMPLE_HIGHLIGHT_SQUARE_OPAQUE

public static final int SAMPLE_HIGHLIGHT_SQUARE_OPAQUE
Use an opaque square as a sample highlighter on a line.

See Also:
Constant Field Values
Constructor Detail

LineChart

public LineChart()
Creates a line chart with one series, 5 samples, and a range of 0-100.


LineChart

public LineChart(int seriesCount,
                 int sampleCount,
                 double range)
Creates a line chart with the specified number of series, the number of samples per serie, and the chart range.

Parameters:
seriesCount - The number of sample series.
sampleCount - The number of samples per series.
range - The upper range of the chart.
Throws:
java.lang.IllegalArgumentException - If the seriesCount is less than 1

LineChart

public LineChart(int seriesCount,
                 int sampleCount,
                 double range,
                 double lowerRange)
Creates a line chart with the specified number of series, the number of samples per serie, and the chart range.

Parameters:
seriesCount - The number of sample series.
sampleCount - The number of samples per series.
range - The upper range of the chart.
lowerRange - The lower range of the chart.
Throws:
java.lang.IllegalArgumentException - If the seriesCount is less than 1
Method Detail

calculateChartData

protected void calculateChartData(java.awt.Rectangle grid,
                                  java.awt.Rectangle dataBounds)
Calculates chart data. Needs to be called before renderData().

Specified by:
calculateChartData in class Chart
Parameters:
grid - The chart grid.
dataBounds - The scrolled data bounds.

checkDataIntegrity

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

Overrides:
checkDataIntegrity in class Chart

checkSelection

public com.objectplanet.chart.ChartSample checkSelection(java.awt.Point point)
If we select a box in the legend, it returns a ChartSample with the correct series, but the sample is set to -1. If we select a valid point the ChartSample representing this point is returned.

Overrides:
checkSelection in class Chart
Parameters:
point - The point to check for.
Returns:
The sample selected, or null if none was selected.

getGraphBounds

public java.awt.Rectangle getGraphBounds()
Calculates the bounding rectangle of the graph itself, based on which features are on and how they are configured.

Specified by:
getGraphBounds in class Chart

getLegendLabels

public java.lang.String[] getLegendLabels()
Gets the legend labels.

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

getLineWidth

public int getLineWidth(int series)
Gets the current width of the given series line.

Parameters:
series - The index of the data series.
Returns:
The width in pixels.

getMaxValue

public double getMaxValue(int serie)
Gets the maximum value in the chart. If the series is given, the value returned will be the maximum value in that series. If the series is -1, the value returned will be the maximum in any series. If the series is -2, the value is the highest stacked value.

Overrides:
getMaxValue in class Chart
Parameters:
serie - The index of the series.

getSampleHighlightSize

public int getSampleHighlightSize(int series)
Gets the sample highlight size.

Parameters:
series - The series to get the size for.
Returns:
The size in pixels.
Throws:
java.lang.IllegalArgumentException - if the series is invalid.

getSampleHighlightStyle

public int getSampleHighlightStyle(int series)
Gets the sample highlight style.

Parameters:
series - The series to get the style for.
Returns:
SAMPLE_HIGHLIGHT_CIRCLE, SAMPLE_HIGHLIGHT_CIRCLE_OPAQUE, SAMPLE_HIGHLIGHT_CIRCLE_FILLED, SAMPLE_HIGHLIGHT_SQUARE, SAMPLE_HIGHLIGHT_SQUARE_OPAQUE, SAMPLE_HIGHLIGHT_SQUARE_FILLED, SAMPLE_HIGHLIGHT_DIAMOND, SAMPLE_HIGHLIGHT_DIAMOND_OPAQUE, SAMPLE_HIGHLIGHT_DIAMOND_FILLED.
Throws:
java.lang.IllegalArgumentException - if the series is invalid.

getValueLabelStyle

public int getValueLabelStyle()
Gets the value label style.

Returns:
OUTSIDE, INSIDE or FLOATING
See Also:
setValueLabelStyle(int)

getValuePosition

public int getValuePosition(double value)
Gets the position in the chart of the specified value.

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)

isConnectedLinesOn

public boolean isConnectedLinesOn(int serie)
Checks if lines with missing values are connected.

Parameters:
serie - The index of the series to check, -1 for all.
Returns:
True if connected, false if not.
See Also:
setConnectedLinesOn(int, boolean)

isRightToLeftScrollingOn

public boolean isRightToLeftScrollingOn()
Checks if the right to left scrolling is turned on.

Returns:
True if on, false if off.
See Also:
setRightToLeftScrollingOn(boolean)

isSampleHighlightOn

public boolean isSampleHighlightOn(int series,
                                   int sample)
Checks if the sample highlight is turned on or off for a sample.

Parameters:
series - The data series where the sample is.
Returns:
True if on, false if off.
Throws:
java.lang.IllegalArgumentException - if the series or sample is invalid.

isSeriesLineOn

public boolean isSeriesLineOn(int serie)
Checks if the specified line is on.

Parameters:
serie - The index of the data series.
Returns:
True if on, false for off.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If the series is invalid.
See Also:
setSeriesLineOn(int, boolean)

isStackedOn

public boolean isStackedOn()
Checks if stacked lines are turned on.

Returns:
True if on, false if off.
See Also:
setStackedOn(boolean)

render

public void render(java.awt.Graphics g)
Renders the line chart according to the set attributes and the current features that are turned on. and GUI state values.

Specified by:
render in class Chart
Parameters:
g - The graphics context used to paint with.
See Also:
Chart.paint(java.awt.Graphics)

renderData

protected void renderData(java.awt.Graphics g,
                          java.awt.Rectangle grid,
                          java.awt.Rectangle dataBounds)
Renders the lines for the chart.

Specified by:
renderData in class Chart
Parameters:
g - The graphics context used to paint with.
grid - The chart grid bounds to paint data within.
dataBounds - The scrolled bounds to calculate the data within.

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 sample label spacing. If this is on, only sample 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.

setConnectedLinesOn

public void setConnectedLinesOn(int serie,
                                boolean on)
Connects lines with missing values. By default, if you have missing or undefined values in a series there will be a hole in the line where the missing value is.

Parameters:
serie - The index of the series, -1 for all.
on - True for on, false for off.

setLegendImage

public void setLegendImage(int index,
                           java.lang.String name)
Sets an image to be used in front of the legend label and as the sample highlight for the specified series.

Overrides:
setLegendImage in class Chart
Parameters:
index - The index of the legend entry to set the image for.
name - The image to use, null for the default legend box.
See Also:
Chart.addImage(java.lang.String, java.awt.Image)

setLineWidth

public void setLineWidth(int series,
                         int width)
Sets the width of the specified line.

Parameters:
series - The series number, -1 for all.
width - The width in pixels, default is 2.

setRightToLeftScrollingOn

public void setRightToLeftScrollingOn(boolean state)
Turns on right to left scrolling when adding new values. Turning this on will paint a line with the right end of the line adjusted with the right edge of the chart grid. When a new value is appended, the line will scroll to the left (same as the CPU usage history in Windows).

Parameters:
state - True for on, false for off. Default is off.

setSampleColors

public void setSampleColors(java.awt.Color[] colors)
Sets the sample colors. If the number of samples is larger than the number of colors, the colors of the samples will cycle through the array. To use the default colors, use NULL as a parameter.

Overrides:
setSampleColors in class Chart
Parameters:
colors - An array with the colors to be used, null for default colors.

setSampleHighlightOn

public void setSampleHighlightOn(boolean on)
Turns on or off the sample highlight for the data series.

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

setSampleHighlightOn

public void setSampleHighlightOn(int series,
                                 boolean on)
Turns on or off the sample highlight for a data series.

Parameters:
series - The series to turn highlights on or off for.
on - True for on, false for off.
Throws:
java.lang.IllegalArgumentException - if the series is invalid.

setSampleHighlightOn

public void setSampleHighlightOn(int series,
                                 int sample,
                                 boolean on)
Turns on or off the sample highlight for a sample in a data series.

Parameters:
series - The series where the sample is located.
sample - The sample on that serie to turn on or off.
on - True for on, false for off.
Throws:
java.lang.IllegalArgumentException - if the series is invalid.

setSampleHighlightStyle

public void setSampleHighlightStyle(int style,
                                    int size)
Sets the sample highlight style for all the data series.

Parameters:
style - SAMPLE_HIGHLIGHT_CIRCLE, SAMPLE_HIGHLIGHT_CIRCLE_OPAQUE, SAMPLE_HIGHLIGHT_CIRCLE_FILLED, SAMPLE_HIGHLIGHT_SQUARE, SAMPLE_HIGHLIGHT_SQUARE_OPAQUE, SAMPLE_HIGHLIGHT_SQUARE_FILLED, SAMPLE_HIGHLIGHT_DIAMOND, SAMPLE_HIGHLIGHT_DIAMOND_OPAQUE, SAMPLE_HIGHLIGHT_DIAMOND_FILLED.
size - The size of the circle or square.
Throws:
java.lang.IllegalArgumentException - if the type is invalid.
java.lang.IndexOutOfBoundsException - if the series is invalid.

setSampleHighlightStyle

public void setSampleHighlightStyle(int serie,
                                    int style,
                                    int size)
Sets the sample highlight style for the specified data series.

Parameters:
serie - The index of the serie.
style - SAMPLE_HIGHLIGHT_CIRCLE, SAMPLE_HIGHLIGHT_CIRCLE_OPAQUE, SAMPLE_HIGHLIGHT_CIRCLE_FILLED, SAMPLE_HIGHLIGHT_SQUARE, SAMPLE_HIGHLIGHT_SQUARE_OPAQUE, SAMPLE_HIGHLIGHT_SQUARE_FILLED, SAMPLE_HIGHLIGHT_DIAMOND, SAMPLE_HIGHLIGHT_DIAMOND_OPAQUE, SAMPLE_HIGHLIGHT_DIAMOND_FILLED.
size - The size of the circle or square.
Throws:
java.lang.IndexOutOfBoundsException - if the series is invalid.

setSeriesLineOn

public void setSeriesLineOn(boolean state)
Turns on or off the series lines. If this is turned off and the sample highlights are turned on, only the highlight shapes will be painted, and not the lines. It is turned on by default.

Parameters:
state - True for on (default), false for off.

setSeriesLineOn

public void setSeriesLineOn(int serie,
                            boolean state)
Turns on or off the specified series line. If this is turned off and the sample highlights are turned on, only the highlight shapes will be painted.

Parameters:
serie - The series index.
state - True for on (default), false for off.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If the series is invalid.

setStackedOn

public void setStackedOn(boolean on)
Turns on or off stacked lines. When the lines are stacked they will be painted filled on top of each other.

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

setValueLabelStyle

public void setValueLabelStyle(int style)
Sets the value label style. The label can be displayed above or above the sample point, at the sample point itself, or floating over the sample point when the mouse hovers over it.

Parameters:
style - OUTSIDE, INSIDE, FLOATING.