NetCharts Pro

netcharts.pro.charts.strip
Class NFStripchart

java.lang.Object
  extended by netcharts.pro.common.NFGraph
      extended by netcharts.pro.common.zoomable.NFZoomableChart
          extended by netcharts.pro.common.rectangular.NFDataChart
              extended by netcharts.pro.charts.strip.NFStripchart
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, NFDragObserver, NFDwellObserver, NFGraphObserver, NFScrollObserver

public class NFStripchart
extends NFDataChart

Represents a strip chart. Strip Charts are ideal for displaying time based data that is periodically updated. Some examples are performance meters, currency tracking, stock tracking, seismograph, and so on. The Strip Chart is designed to make implementing this type of chart easy, fast, and Internet accessible. The Strip Chart is based on a certain number of "slots" in the X axis. The slots are equally divided into the available graphing space and represent a particular point in time. The rightmost slot contains the newest data, and the leftmost slot has the oldest displayed data. Data in multiple data sets is added synchronously, with one point being extracted from each dataset as each new slot is added. Note that data is only displayed in the graph after the doUpdate method call.

See Also:
Serialized Form

Field Summary
static java.util.Hashtable barstyleTypeMap
          bar style type hashtable
static int GROUP
          Group bar style
static int LINE_SYMBOL_ANIMATION_STYLE_FADE
          Line symbol animation style fade
static int LINE_SYMBOL_ANIMATION_STYLE_NONE
          No line symbol animation style
static int LINE_SYMBOL_ANIMATION_STYLE_SCALE
          Line symbol animation style scale
static int STACK
          Stacked bar style
 
Fields inherited from class netcharts.pro.common.rectangular.NFDataChart
GRID_ANIMATION_STYLE_FADE, GRID_ANIMATION_STYLE_NONE
 
Fields inherited from class netcharts.pro.common.zoomable.NFZoomableChart
NOZOOM, zoomActionsMap, ZOOMIN, ZOOMOUT
 
Fields inherited from class netcharts.pro.common.NFGraph
ANTIALIAS_OFF, ANTIALIAS_ON, ANTIALIAS_ONDRAW, ANTIALIAS_ONTEXT, antiAliasModeMap, BAR, BAR3D, BOX, BUBBLE, COMBO, DIAGRAM, DIAL, DWELL_ANIMATION_STYLE_HIGHLIGHT, DWELL_ANIMATION_STYLE_NONE, FADE, HEATMAP, HIGHLIGHT, HISTOGRAM, LABEL_ANIMATION_STYLE_FADE, LABEL_ANIMATION_STYLE_NONE, LEGEND_ANIMATION_STYLE_FADE, LEGEND_ANIMATION_STYLE_NONE, LEGEND_DWELL_ANIMATION_STYLE_HIGHLIGHT, LEGEND_DWELL_ANIMATION_STYLE_NONE, LINE, MULTIPIE, PARETO, PIE, POLAR, RADAR, STOCK, STRIP, TIME, XY
 
Constructor Summary
NFStripchart()
          Constructs a default chart object.
NFStripchart(javax.swing.JPanel panel)
          Constructs a chart object on the given JPanel.
NFStripchart(javax.swing.JPanel panel, java.util.Properties initProperties)
          Constructs a chart object on the given JPanel.
NFStripchart(java.util.Properties initProperties)
          Constructs a chart object on the given JPanel.
 
Method Summary
 void addDataSlot(double[] data)
          Adds an array of elements for one slot.
 void addDataSlot(double[] data, java.lang.String bottomLabel, java.lang.String topLabel)
          Adds an array of elements for one slot.
 void addLineSet(NFLineSet lineSet)
          Adds a line set to the current list of linesets.
 int getBarStyle()
          Get bar style, either GROUP (default) or STACK
 NFAxis getBottomAxis()
          Returns the bottom axis object.
 NFAxisSeries getBottomAxisSeries()
          Overrides NFDataChart.
 int getDataBufferSize()
          Gets the stripchart data buffer size.
 java.lang.String getDefaultData()
          Returns a string of default data
 boolean getFillFromLeft()
          Gets how the initial fill should occur
 NFStripLineSeries getLineSeries()
          Get the line series.
 int getLineSymbolAnimationStyle()
          Get the line symbol animation style.
 NFModalLabel getLineValueLabel()
          Get the text style to use for line labels.
 NFRegion getLineValueLabelRegion()
          Get the text background style to use for line labels.
 int getNumberOfSlotsShown()
          Gets the stripchart number of slots parameter.
 NFAxis getTopAxis()
          Returns the top axis object.
 NFAxisSeries getTopAxisSeries()
          Overrides NFDataChart.
 int getType()
          Gets the chart type.
 java.lang.String getUndefinedString()
          Gets the text to be used if a tic label is not passed.
 void resetState()
          Resets all of the parameter values to their initial state.
 void setBarStyle(int barStyle)
          Set bar style, either GROUP (default) or STACK
 void setBottomAxis(NFAxis bottomAxis)
          Sets the bottom NFStripAxis object.
 void setBottomAxisSeries(NFAxisSeries bottomAxisSeries)
          Overrides NFDataChart.
 void setDataBufferSize(int dataBufferSize)
          Sets the stripchart data buffer size.
 void setFillFromLeft(boolean fillFromLeft)
          Sets how the initial fill should occur
 void setLineSeries(NFStripLineSeries lineSeries)
          Set the line series.
 void setLineSymbolAnimationStyle(int style)
          Set the line symbol animation style.
 void setLineValueLabel(NFModalLabel lineValueLabel)
          Set the text style to use for line labels.
 void setLineValueLabelRegion(NFRegion lineValueRegion)
          Set the text background style to use for line labels.
 void setNumberOfSlotsShown(int numSlots)
          Sets the stripchart number of slots parameter.
 void setStripLayout(int numSlots, int dataBufferSize, boolean fillFromLeft, java.lang.String undefinedString)
          Sets the stripchart configuration
 void setTopAxis(NFAxis topAxis)
          Sets the top NFStripAxis object.
 void setTopAxisSeries(NFAxisSeries topAxisSeries)
          Overrides NFDataChart.
 void setUndefinedString(java.lang.String undefinedString)
          Sets the text to be used if a tic label is not passed.
 void writeChart(java.lang.StringBuffer sb)
          Writes this chart into a string buffer
 void writeExternal(java.io.ObjectOutput out)
          Writes this chart into an object for serialization.
 
Methods inherited from class netcharts.pro.common.rectangular.NFDataChart
addGrid, getAutoscalePad, getAxesSizes, getAxisThickness, getGrid, getGridAnimationStyle, getGridDepth, getGridSeries, getLeftAxis, getLeftAxisSeries, getRightAxis, getRightAxisSeries, getXAxis, getYAxis, setAutoscalePad, setAxesSizes, setAxisThickness, setGrid, setGridAnimationStyle, setGridDepth, setGridSeries, setLeftAxis, setLeftAxisSeries, setRightAxis, setRightAxisSeries
 
Methods inherited from class netcharts.pro.common.zoomable.NFZoomableChart
getMouseControlDown, getMouseMetaDown, getMouseShiftDown, getZoomingEnabled, setMouseControlDown, setMouseMetaDown, setMouseShiftDown, setZoomingEnabled, zoom
 
Methods inherited from class netcharts.pro.common.NFGraph
addChartActionListener, addGraphObserver, addNote, addPropertyChangeListener, display, dwellDisplay, dwellPress, finalize, getActiveClicks, getAlwaysUpdate, getAntiAlias, getAntiAliasMode, getBackgroundActiveLabel, getBackgroundFillPattern, getBackgroundRegion, getBuildAnimationEnabled, getCDL, getChartElementSpacing, getChartName, getChartSize, getColorTable, getDataActiveLabelsEnabled, getDwell, getDwellAnimation, getDwellAnimationHighlight, getDwellAnimationStyle, getDwellOffset, getErrors, getFooter, getGraph, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphGraphics, getHeader, getLabelAnimationStyle, getLeftTitle, getLegend, getLegendAnimationStyle, getLegendDwellAnimation, getLegendDwellAnimationHighlight, getLegendDwellAnimationStyle, getLicenseActivationKey, getMetaData, getMinimumSize, getNoteSeries, getNumberFormat, getNumErrors, getPanel, getPlotArea, getPreferredSize, getRightTitle, getRootPanel, getRubberband, getScaleFactor, getTitleSpacing, getToggleDataVisibility, getVersion, graphDrawn, graphTooSmall, initializeFromFile, initializeFromString, initializeFromURL, loadFromTemplate, loadFromTemplate, loadFromTemplate, loadLicenseFile, paint, postDrag, postScroll, preDrag, preScroll, readExternal, removeChartActionListener, removeGraphObserver, removePropertyChangeListener, sendData, sendData, sendData, sendData, sendUpdate, set, set, set, set, set, set, setActiveClicks, setAlwaysUpdate, setAntiAlias, setAntiAliasMode, setBackgroundActiveLabel, setBackgroundFillPattern, setBackgroundRegion, setBuildAnimationEnabled, setChartElementSpacing, setChartName, setChartSize, setColorTable, setDataActiveLabelsEnabled, setDocumentBase, setDwell, setDwellAnimation, setDwellAnimationHighlight, setDwellAnimationStyle, setDwellOffset, setFooter, setHeader, setLabelAnimationStyle, setLeftTitle, setLegend, setLegendAnimationStyle, setLegendDwellAnimation, setLegendDwellAnimationHighlight, setLegendDwellAnimationStyle, setLicenseKey, setLicenseKey, setLicenseLocation, setMetaData, setNoteSeries, setNumberFormat, setParentApplet, setPlotArea, setRightTitle, setRubberband, setScaleFactor, setSize, setSize, setTitleSpacing, setToggleDataVisibility, start, stop, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STACK

public static final int STACK
Stacked bar style

See Also:
Constant Field Values

GROUP

public static final int GROUP
Group bar style

See Also:
Constant Field Values

barstyleTypeMap

public static java.util.Hashtable barstyleTypeMap
bar style type hashtable


LINE_SYMBOL_ANIMATION_STYLE_NONE

public static final int LINE_SYMBOL_ANIMATION_STYLE_NONE
No line symbol animation style

See Also:
Constant Field Values

LINE_SYMBOL_ANIMATION_STYLE_SCALE

public static final int LINE_SYMBOL_ANIMATION_STYLE_SCALE
Line symbol animation style scale

See Also:
Constant Field Values

LINE_SYMBOL_ANIMATION_STYLE_FADE

public static final int LINE_SYMBOL_ANIMATION_STYLE_FADE
Line symbol animation style fade

See Also:
Constant Field Values
Constructor Detail

NFStripchart

public NFStripchart()
Constructs a default chart object.


NFStripchart

public NFStripchart(javax.swing.JPanel panel)
Constructs a chart object on the given JPanel.

Parameters:
panel - Panel to draw chart on.

NFStripchart

public NFStripchart(java.util.Properties initProperties)
Constructs a chart object on the given JPanel.

Parameters:
initProperties - A java.util.Properties object containing the set of runtime properties to use when generating the chart. See the netcharts.pro.common.NFGraph(java.util.Properties) constructor for a list of valid Properties.

NFStripchart

public NFStripchart(javax.swing.JPanel panel,
                    java.util.Properties initProperties)
Constructs a chart object on the given JPanel.

Parameters:
panel - Panel to draw chart on.
initProperties - A java.util.Properties object containing the set of runtime properties to use when generating the chart. See the netcharts.pro.common.NFGraph(java.util.Properties) constructor for a list of valid Properties.
Method Detail

getDefaultData

public java.lang.String getDefaultData()
Returns a string of default data

Specified by:
getDefaultData in class NFGraph
Returns:
The default data used to initialize a chart.

setBarStyle

public void setBarStyle(int barStyle)
Set bar style, either GROUP (default) or STACK

Parameters:
barStyle -

getBarStyle

public int getBarStyle()
Get bar style, either GROUP (default) or STACK

Returns:
barStyle

addLineSet

public void addLineSet(NFLineSet lineSet)
Adds a line set to the current list of linesets.

Parameters:
lineSet - The lineset to add.

setLineSeries

public void setLineSeries(NFStripLineSeries lineSeries)
                   throws NFParamException
Set the line series. This is a vector of NFLineSets. To set a property on the line series, you must first retrieve the series, then set the property (properties) and finally set the line series.
     NFStripchart chart = new NFStripchart();
     NFStripLineSeries ls = chart.getLineSeries();
     NFLineSet set = (NFLineSet)ls.elementAt(0);
     // Set some of the properties on the NFLineSet
     ...
     ls.setElementAt(set, 0);
     chart.setLineSeries(ls);
 

Parameters:
lineSeries -
Throws:
NFParamException

getLineSeries

public NFStripLineSeries getLineSeries()
Get the line series. This is a vector of NFLineSets. To set a property on the line series, you must first retrieve the series, then set the property (properties) and finally set the line series.
     NFStripchart chart = new NFStripchart();
     NFStripLineSeries ls = chart.getLineSeries();
     NFLineSet set = (NFLineSet)ls.elementAt(0);
     // Set some of the properties on the NFLineSet
     ...
     ls.setElementAt(set, 0);
     chart.setLineSeries(ls);
 

Returns:
lineSeries

getType

public int getType()
Gets the chart type.

Specified by:
getType in class NFGraph
Returns:
the type of this chart, always netcharts.pro.charts.strip.NFGraph.STRIP

setBottomAxis

public void setBottomAxis(NFAxis bottomAxis)
Sets the bottom NFStripAxis object. This method overrides the setBottomAxis method in NFDataChart. An instance of NFStripAxis must be passed in or an exception is thrown.

Overrides:
setBottomAxis in class NFDataChart
Parameters:
bottomAxis -

getBottomAxis

public NFAxis getBottomAxis()
Returns the bottom axis object. The return object will be an instance of NFStripAxis.

Overrides:
getBottomAxis in class NFDataChart
Returns:
bottomAxis

setBottomAxisSeries

public void setBottomAxisSeries(NFAxisSeries bottomAxisSeries)
Overrides NFDataChart. Strip charts do not support multiple bottom axes, so no action is taken.

Overrides:
setBottomAxisSeries in class NFDataChart
Parameters:
bottomAxisSeries -

getBottomAxisSeries

public NFAxisSeries getBottomAxisSeries()
Overrides NFDataChart. Strip charts do not support multiple bottom axes, so null is returned

Overrides:
getBottomAxisSeries in class NFDataChart
Returns:
bottomAxisSeries

setTopAxis

public void setTopAxis(NFAxis topAxis)
Sets the top NFStripAxis object. This method overrides the setTopAxis method in NFDataChart. An instance of NFStripAxis must be passed in or an exception is thrown.

Overrides:
setTopAxis in class NFDataChart
Parameters:
topAxis -

getTopAxis

public NFAxis getTopAxis()
Returns the top axis object. The return object will be an instance of NFStripAxis.

Overrides:
getTopAxis in class NFDataChart
Returns:
topAxis

setTopAxisSeries

public void setTopAxisSeries(NFAxisSeries topAxisSeries)
Overrides NFDataChart. Strip charts do not support multiple bottom axes, so no action is taken.

Overrides:
setTopAxisSeries in class NFDataChart
Parameters:
topAxisSeries -

getTopAxisSeries

public NFAxisSeries getTopAxisSeries()
Overrides NFDataChart. Strip charts do not support multiple bottom axes, so null is returned

Overrides:
getTopAxisSeries in class NFDataChart
Returns:
null

addDataSlot

public void addDataSlot(double[] data)
Adds an array of elements for one slot. Each element in the array is expected to correspond with each current lineset.

Parameters:
data - An array of data elements

addDataSlot

public void addDataSlot(double[] data,
                        java.lang.String bottomLabel,
                        java.lang.String topLabel)
Adds an array of elements for one slot. Each element in the array is expected to correspond with each current lineset. Also provides the ability to pass top and bottom labels for the slot.

Parameters:
data - An array of data elements
bottomLabel - The slot bottom tic label. Set to null if not needed.
topLabel - The slot top tic label. Set to null if not needed.

setStripLayout

public void setStripLayout(int numSlots,
                           int dataBufferSize,
                           boolean fillFromLeft,
                           java.lang.String undefinedString)
Sets the stripchart configuration

Parameters:
numSlots - Number of discrete data slots in the X axis.
dataBufferSize - The size of the buffer that holds data before display.
fillFromLeft - If true, the points will start at the left of the data window.
undefinedString - Text to put on a tic label if the label has not been otherwise defined.

setNumberOfSlotsShown

public void setNumberOfSlotsShown(int numSlots)
Sets the stripchart number of slots parameter. This identifies how many "steps" there are in the chart's X axis

Parameters:
numSlots - Number of discrete data slots in the X axis.

getNumberOfSlotsShown

public int getNumberOfSlotsShown()
Gets the stripchart number of slots parameter. This identifies how many "steps" there are in the chart's X axis

Returns:
number of discrete data slots in the X axis or 10 if not defined.

setDataBufferSize

public void setDataBufferSize(int dataBufferSize)
Sets the stripchart data buffer size.

Parameters:
dataBufferSize - The size of the input data buffer.

getDataBufferSize

public int getDataBufferSize()
Gets the stripchart data buffer size.

Returns:
the size of the input data buffer.

setFillFromLeft

public void setFillFromLeft(boolean fillFromLeft)
Sets how the initial fill should occur

Parameters:
fillFromLeft - If true, points will fill the stripchart from the left side.

getFillFromLeft

public boolean getFillFromLeft()
Gets how the initial fill should occur

Returns:
true if points are to fill the stripchart from the left side.

setUndefinedString

public void setUndefinedString(java.lang.String undefinedString)
Sets the text to be used if a tic label is not passed.

Once any portion of the StripLayout has been defined, the undefined string will not be changed until data is added.

It is recommended that this value be set either during initialization (via a StripLayout CDL parameter in a template, or programmatically before any other StripLayout related parameters, numberOfSlotsShown, fillFromLeft and dataBufferSize. Once any of these parameters are set, the undefined string will not be changed until data is added.

Parameters:
undefinedString - Text to be used when a tic label is not passed.

getUndefinedString

public java.lang.String getUndefinedString()
Gets the text to be used if a tic label is not passed.

Returns:
text to be used when a tic label is not passed.

setLineValueLabel

public void setLineValueLabel(NFModalLabel lineValueLabel)
Set the text style to use for line labels.

Parameters:
lineValueLabel - Text style.

getLineValueLabel

public NFModalLabel getLineValueLabel()
Get the text style to use for line labels.

Returns:
text style or null if not defined.

setLineValueLabelRegion

public void setLineValueLabelRegion(NFRegion lineValueRegion)
Set the text background style to use for line labels.

Parameters:
lineValueRegion - Text background style.

getLineValueLabelRegion

public NFRegion getLineValueLabelRegion()
Get the text background style to use for line labels.

Returns:
text background style.

setLineSymbolAnimationStyle

public void setLineSymbolAnimationStyle(int style)
Set the line symbol animation style.

If the value passed is not a valid line symbol animation style, LINE_SYMBOL_ANIMATION_STYLE_NONE will be used.

Parameters:
style - One of LINE_SYMBOL_ANIMATION_STYLE_NONE (default), LINE_SYMBOL_ANIMATION_STYLE_SCALE or LINE_SYMBOL_ANIMATION_STYLE_FADE

getLineSymbolAnimationStyle

public int getLineSymbolAnimationStyle()
Get the line symbol animation style.

Returns:
type One of LINE_SYMBOL_ANIMATION_STYLE_NONE (default), LINE_SYMBOL_ANIMATION_STYLE_SCALE or LINE_SYMBOL_ANIMATION_STYLE_FADE

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes this chart into an object for serialization.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class NFDataChart
Throws:
java.io.IOException

writeChart

public void writeChart(java.lang.StringBuffer sb)
Writes this chart into a string buffer

Overrides:
writeChart in class NFDataChart

resetState

public void resetState()
Resets all of the parameter values to their initial state.

Overrides:
resetState in class NFDataChart

NetCharts Pro


Visual Mining, Inc.
2099 Gaither Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2011
All Rights Reserved.

NetCharts Pro TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 28, 2011