com.objectplanet.chart.ext
Class SplineChart

java.lang.Object
  extended byjava.awt.Component
      extended bycom.objectplanet.chart.GenericChart
          extended bycom.objectplanet.chart.Chart
              extended bycom.objectplanet.chart.LineChart
                  extended bycom.objectplanet.chart.ext.SplineChart
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable

public class SplineChart
extends LineChart

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

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

 SplineChart chart = new SplineChart();
 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:
 SplineChart chart = new SplineChart();
 chart.setSeriesCount(4);
 chart.setSampleCount(10);
 double[] series0 = new double[] {98,23,46,89,72,36,49,87,23,64};
 double[] series1 = new double[] {80,17,92,63,98,16,53,86,52,34};
 double[] series2 = new double[] {29,83,46,93,80,72,36,42,98,36};
 double[] series3 = new double[] {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);

Author:
Mattias Ask., Philipp Kolibaba.
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
 
Fields inherited from class com.objectplanet.chart.LineChart
BEHIND_LINE_LAYOUT, LINE_STYLE_LINE, LINE_STYLE_TUBE, SAME_LEVEL_LINE_LAYOUT, SAMPLE_HIGHLIGHT_CIRCLE, SAMPLE_HIGHLIGHT_CIRCLE_FILLED, SAMPLE_HIGHLIGHT_CIRCLE_OPAQUE, SAMPLE_HIGHLIGHT_DIAMOND, SAMPLE_HIGHLIGHT_DIAMOND_FILLED, SAMPLE_HIGHLIGHT_DIAMOND_OPAQUE, SAMPLE_HIGHLIGHT_SQUARE, SAMPLE_HIGHLIGHT_SQUARE_FILLED, SAMPLE_HIGHLIGHT_SQUARE_OPAQUE
 
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 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
SplineChart()
          Creates a smooth point line chart with one series, 5 samples, and a range of 0-100.
SplineChart(int seriesCount, int sampleCount, double range)
          Creates a smooth point line chart with the specified number of series, the number of samples per serie, and the chart range.
SplineChart(int seriesCount, int sampleCount, double range, double lowerRange)
          Creates a smooth point line chart with the specified number of series, the number of samples per serie, and the chart range.
 
Methods inherited from class com.objectplanet.chart.LineChart
checkDataIntegrity, checkSelection, getArea, getAreaColor, getAreaColor2, getHighestValue, getLegendImage, getLegendLabels, getLine3DDepth, getLine3DLayout, getLineStroke, getLineStyle, getLineWidth, getMaxValue, getSampleHighlightImage, getSampleHighlightSize, getSampleHighlightStyle, getSamplePoint, getValuePosition, isAutoLabelSpacingOn, isConnectedLinesOn, isOutlineOn, isRightToLeftScrollingOn, isSampleHighlightOn, isSampleHighlightOn, isSeriesLineOn, isStackedOn, paint3DLine, paintLine, paintSampleHighlight, reset, setArea, setAreaColor, setAreaColor2, setAutoLabelSpacingOn, setConnectedLinesOn, setLine3DDepth, setLine3DLayout, setLineStroke, setLineStyle, setLineWidth, setOutlineOn, setRightToLeftScrollingOn, setSampleColors, setSampleHighlightImage, setSampleHighlightOn, setSampleHighlightOn, setSampleHighlightOn, setSampleHighlightStyle, setSampleHighlightStyle, setSeriesLineOn, setSeriesLineOn, setStackedOn
 
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, getLastSelectedSample, getLastSelectedSeries, getLegendColor, getLowerRange, getLowestValue, 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, 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, setLowerRange, setLowerRelativeRange, setLowerRelativeRange, setLowerRelativeRange, setMaxValueLineCount, setRange, setRangeAdjusted, setRangeAdjusterOn, setRangeAdjusterPosition, setRangeColor, setRangeDecimalCount, setRangeFormatter, setRangeInterval, setRangeLabelsOn, setRangeOn, setRangePosition, setRelativeRange, setRelativeRange, setRelativeRange, setSample, setSampleAxisRange, setSampleColor, setSampleColor2, 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, getLegendPosition, getLocale, getMinimumSize, getOverlayChart, getOverlayInsets, getPreferredSize, getSize, getThousandsDelimeter, getTitle, getTotalGraphBounds, getVersion, handleCustomLabels, is3DModeOn, isAntialiasingOn, isAutomaticRepaintOn, isFloatingOnLegendOn, isGridOutline3DOn, isLegendOn, isLegendReverseOn, isMultiSeriesOn, isOverlayChartOn, isPrintAsBitmap, 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, setMultiSeriesOn, setNeedChartCalculation, setOverlayChart, setOverlayChartOn, setOverlayInsets, setPreferredSize, setPrintAsBitmap, setServletModeOn, setThousandsDelimiter, setTitle, setTitleOn, setZoomOn, 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, 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, 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
 

Constructor Detail

SplineChart

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


SplineChart

public SplineChart(int seriesCount,
                   int sampleCount,
                   double range)
Creates a smooth point 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

SplineChart

public SplineChart(int seriesCount,
                   int sampleCount,
                   double range,
                   double lowerRange)
Creates a smooth point 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