NetCharts Pro

netcharts.pro.common.barset
Class NFAbstractBarchart

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.common.barset.NFAbstractBarchart
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, NFDragObserver, NFDwellObserver, NFGraphObserver, NFScrollObserver
Direct Known Subclasses:
NFAbstractGroupStackableBarchart, NFParetochart

public abstract class NFAbstractBarchart
extends NFDataChart

Represents an abstract bar chart. Provides the ability to configure the chart via object manipulation or directly from CDL.

See Also:
Serialized Form

Field Summary
static int BAR_ANIMATION_STYLE_FADE
          Bar animation style fade
static int BAR_ANIMATION_STYLE_GROW
          Bar animation style grow
static int BAR_ANIMATION_STYLE_NONE
          No bar animation style
static java.util.Hashtable barchartTypeMap
          barchart type hashtable
static int BOTTOMUP
          Stack bar sets from the bottom up when barchart type is stack
static int GROUP
          Group barchart type
static int GROUPSTACK
          Stacked/Grouped barchart type
static int HORIZONTAL
          Horizontal orientation
static int ITEM
          Discrete value shown on popup when barchart type is stack
static java.util.Hashtable orientationMap
          orientation hashtable
static int ROWS
          Row barchart type
static int STACK
          Stacked barchart type
static java.util.Hashtable stackDisplayOrderMap
          stack display order hashtable
static java.util.Hashtable stackTypeMap
          barchart stack type hashtable
static int TOPDOWN
          Stack bar sets from the top down when barchart type is stack
static int TOTAL
          Total value shown on popup when barchart type is stack
static int VERTICAL
          Vertical orientation
 
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
NFAbstractBarchart()
          Constructs a default chart object.
NFAbstractBarchart(javax.swing.JPanel panel)
          Constructs a chart object on the given JPanel.
NFAbstractBarchart(javax.swing.JPanel panel, java.util.Properties initProperties)
          Constructs a chart object on the given JPanel with the specified properties.
NFAbstractBarchart(java.util.Properties initProperties)
          Constructs a chart object with the specified properties.
 
Method Summary
 void addBarSet(NFBarSet barSet)
          Adds a bar set to the current list of barsets.
 NFVector getBarActiveLabels()
          Get active labels to be associated with each data label.
 int getBarAnimationStyle()
          Get the bar animation style.
 NFLine getBarBorder()
          Returns the bar border for this bar chart
 NFCorners getBarCorners()
          Get the corners of the bars
 NFDropShadow getBarDropShadow()
          Get the drop shadow for the bars
 NFBarHighlightSeries getBarHighlightSeries()
          Get the bar highlight series.
 NFBarSeries getBarSeries()
          Get the bar series.
 NFSpotlightSeries getBarSpotlightSeries()
          Get the bar spotlight series.
 NFModalLabel getBarValueLabel()
          Get the text style to use for labeling bars in this barset.
 NFRegion getBarValueLabelRegion()
          Get the text background style to use for labeling bars in this barset.
 int getBarWidth()
          Get bar width.
 NFVector getBarWidths()
          Get the bar widths.
 NFVector getDataLabels()
          Get the labels to be displayed under each bar.
 int getStackDisplayOrder()
          Get barchart stack display order, either BOTTOMUP or TOPDOWN.
 int getStackType()
          Get barchart stack type, either TOTAL or ITEM.
 NFModalLabel getZAxisLabels()
          Returns the text style and value to use for labeling the Z Axis.
 void resetState()
          Resets all of the parameter values to their initial state.
 void setBarActiveLabels(NFVector barActiveLabels)
          Set active labels to be associated with each data label.
 void setBarAnimationStyle(int style)
          Set the bar animation style.
 void setBarBorder(NFLine barBorder)
          Set border for this bar chart
 void setBarCorners(NFCorners barCorners)
          Set the corners of the bars
 void setBarDropShadow(NFDropShadow barDropShadow)
          Set the drop shadow for the bars
 void setBarHighlightSeries(NFBarHighlightSeries barHighlightSeries)
          Set the bar highlight series.
 void setBarSeries(NFBarSeries barSeries)
          Set the bar series.
 void setBarSpotlightSeries(NFSpotlightSeries barSpotlightSeries)
          Set the bar spotlight series.
 void setBarValueLabel(NFModalLabel barValueLabel)
          Set the text style to use for labeling bars in this barset.
 void setBarValueLabelRegion(NFRegion barValueRegion)
          Set the text background style to use for labeling bars in this barset.
 void setBarWidth(int barWidth)
          Set bar width.
 void setBarWidths(NFVector barWidths)
          Set the bar widths.
 void setDataLabels(NFVector dataLabels)
          Set the labels to be displayed under each bar.
 void setStackDisplayOrder(int stackDisplayOrder)
          Set barchart stack display order, either BOTTOMUP or TOPDOWN.
 void setStackType(int stackType)
          Set barchart stack type, either TOTAL or ITEM.
 void setZAxisLabels(NFModalLabel zAxisLabel)
          Set the text style and value to use for labeling the Z Axis.
 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, getBottomAxis, getBottomAxisSeries, getGrid, getGridAnimationStyle, getGridDepth, getGridSeries, getLeftAxis, getLeftAxisSeries, getRightAxis, getRightAxisSeries, getTopAxis, getTopAxisSeries, getXAxis, getYAxis, setAutoscalePad, setAxesSizes, setAxisThickness, setBottomAxis, setBottomAxisSeries, setGrid, setGridAnimationStyle, setGridDepth, setGridSeries, setLeftAxis, setLeftAxisSeries, setRightAxis, setRightAxisSeries, setTopAxis, setTopAxisSeries
 
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, getDefaultData, 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, getType, 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

HORIZONTAL

public static final int HORIZONTAL
Horizontal orientation


VERTICAL

public static final int VERTICAL
Vertical orientation


ROWS

public static final int ROWS
Row barchart type

See Also:
Constant Field Values

STACK

public static final int STACK
Stacked barchart type

See Also:
Constant Field Values

GROUP

public static final int GROUP
Group barchart type

See Also:
Constant Field Values

GROUPSTACK

public static final int GROUPSTACK
Stacked/Grouped barchart type

See Also:
Constant Field Values

TOTAL

public static final int TOTAL
Total value shown on popup when barchart type is stack

See Also:
Constant Field Values

ITEM

public static final int ITEM
Discrete value shown on popup when barchart type is stack

See Also:
Constant Field Values

BOTTOMUP

public static final int BOTTOMUP
Stack bar sets from the bottom up when barchart type is stack


TOPDOWN

public static final int TOPDOWN
Stack bar sets from the top down when barchart type is stack


stackDisplayOrderMap

public static java.util.Hashtable stackDisplayOrderMap
stack display order hashtable


orientationMap

public static java.util.Hashtable orientationMap
orientation hashtable


barchartTypeMap

public static java.util.Hashtable barchartTypeMap
barchart type hashtable


stackTypeMap

public static java.util.Hashtable stackTypeMap
barchart stack type hashtable


BAR_ANIMATION_STYLE_NONE

public static final int BAR_ANIMATION_STYLE_NONE
No bar animation style

See Also:
Constant Field Values

BAR_ANIMATION_STYLE_GROW

public static final int BAR_ANIMATION_STYLE_GROW
Bar animation style grow

See Also:
Constant Field Values

BAR_ANIMATION_STYLE_FADE

public static final int BAR_ANIMATION_STYLE_FADE
Bar animation style fade

See Also:
Constant Field Values
Constructor Detail

NFAbstractBarchart

public NFAbstractBarchart()
Constructs a default chart object.


NFAbstractBarchart

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

Parameters:
panel - JPanel to draw chart on.

NFAbstractBarchart

public NFAbstractBarchart(java.util.Properties initProperties)
Constructs a chart object with the specified properties.

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.

NFAbstractBarchart

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

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

setBarBorder

public void setBarBorder(NFLine barBorder)
Set border for this bar chart

Parameters:
barBorder - The line style to use for the bar border

getBarBorder

public NFLine getBarBorder()
Returns the bar border for this bar chart

Returns:
barBorder The line style to use for the bar border

setBarWidth

public void setBarWidth(int barWidth)
Set bar width. Defines the relative width of the bar as a percentage of available space. A smaller number results in more space between bars.

Parameters:
barWidth -

setBarWidths

public void setBarWidths(NFVector barWidths)
Set the bar widths. Defines the relative width of the bar as a percentage of available space. A smaller number results in more space between bars.

Parameters:
barWidths -

getBarWidth

public int getBarWidth()
Get bar width. Defines the relative width of the bar as a percentage of available space. A smaller number results in more space between bars.

Returns:
barWidth

getBarWidths

public NFVector getBarWidths()
Get the bar widths. Defines the relative width of the bar as a percentage of available space. A smaller number results in more space between bars.

Returns:
barWidths

setStackType

public void setStackType(int stackType)
Set barchart stack type, either TOTAL or ITEM. This parameter affects how data values will be shown on the mouseover popup. When stackType is TOTAL, the total value of the bar will be shown. When stackType is ITEM, the value of the moused over segment will be displayed.

If the value passed is not a valid barchart type, ITEM will be used.

Parameters:
stackType - One of ITEM, TOTAL

getStackType

public int getStackType()
Get barchart stack type, either TOTAL or ITEM. This parameter affects how data values will be shown on the mouseover popup. When stackType is TOTAL, the total value of the bar will be shown. When stackType is ITEM, the value of the moused over segment will be displayed.

Returns:
stackType One of ITEM, TOTAL

setStackDisplayOrder

public void setStackDisplayOrder(int stackDisplayOrder)
Set barchart stack display order, either BOTTOMUP or TOPDOWN. This parameter affects which direction the bars are stacked in STACK mode.

Parameters:
stackDisplayOrder - One of BOTTOMUP, TOPDOWN

getStackDisplayOrder

public int getStackDisplayOrder()
Get barchart stack display order, either BOTTOMUP or TOPDOWN. This parameter affects which direction the bars are stacked in STACK mode.

Returns:
One of BOTTOMUP, TOPDOWN

setDataLabels

public void setDataLabels(NFVector dataLabels)
Set the labels to be displayed under each bar. The vector contains a list of string values.


getDataLabels

public NFVector getDataLabels()
Get the labels to be displayed under each bar. The vector contains a list of string values.

Returns:
dataLabels

setBarActiveLabels

public void setBarActiveLabels(NFVector barActiveLabels)
Set active labels to be associated with each data label.

Parameters:
barActiveLabels - Vector of NFActiveLabels

getBarActiveLabels

public NFVector getBarActiveLabels()
Get active labels to be associated with each data label.

Returns:
barActiveLabels Vector of NFActiveLabels

addBarSet

public void addBarSet(NFBarSet barSet)
Adds a bar set to the current list of barsets.

Parameters:
barSet - The barset to add.

setBarSeries

public void setBarSeries(NFBarSeries barSeries)
Set the bar series. This is a vector of barsets. To set a property on the bar series, you must first retrieve the series, then set the property (properties) and finally set the bar series.
      NFBarchart chart = new NFBarchart();
      NFBarSeries bs = chart.getBarSeries();
      NFBarSet set = (NFBarSet)bs.elementAt(0);
      // Set some of the properties on the NFBarSet
      ...
      bs.setElementAt(set, 0);
      chart.setBarSeries(bs);
 

Parameters:
barSeries -

getBarSeries

public NFBarSeries getBarSeries()
Get the bar series. This is a vector of barsets. To set a property on the bar series, you must first retrieve the series, then set the property (properties) and finally set the bar series.
      NFBarchart chart = new NFBarchart();
      NFBarSeries bs = chart.getBarSeries();
      NFBarSet set = (NFBarSet)bs.elementAt(0);
      // Set some of the properties on the NFBarSet
      ...
      bs.setElementAt(set, 0);
      chart.setBarSeries(bs);
 

Returns:
barSeries

setBarHighlightSeries

public void setBarHighlightSeries(NFBarHighlightSeries barHighlightSeries)
Set the bar highlight series.

Parameters:
barHighlightSeries - The series of bar highlights

getBarHighlightSeries

public NFBarHighlightSeries getBarHighlightSeries()
Get the bar highlight series.

Returns:
The series of bar highlights

setBarSpotlightSeries

public void setBarSpotlightSeries(NFSpotlightSeries barSpotlightSeries)
Set the bar spotlight series.

Parameters:
barSpotlightSeries - The series of bar spotlights

getBarSpotlightSeries

public NFSpotlightSeries getBarSpotlightSeries()
Get the bar spotlight series.

Returns:
The series of bar spotlights

setBarDropShadow

public void setBarDropShadow(NFDropShadow barDropShadow)
Set the drop shadow for the bars

Parameters:
barDropShadow - The drop shadow to use under the bars

getBarDropShadow

public NFDropShadow getBarDropShadow()
Get the drop shadow for the bars

Returns:
The drop shadow to use under the bars

setBarCorners

public void setBarCorners(NFCorners barCorners)
Set the corners of the bars

Parameters:
barCorners - The corners of the bars

getBarCorners

public NFCorners getBarCorners()
Get the corners of the bars

Returns:
The corners of the bars

setBarValueLabel

public void setBarValueLabel(NFModalLabel barValueLabel)
Set the text style to use for labeling bars in this barset.

Parameters:
barValueLabel - Text style.

getBarValueLabel

public NFModalLabel getBarValueLabel()
Get the text style to use for labeling bars in this barset.

Returns:
text style or null if not defined.

setBarValueLabelRegion

public void setBarValueLabelRegion(NFRegion barValueRegion)
Set the text background style to use for labeling bars in this barset.

Parameters:
barValueRegion - Text background style.

getBarValueLabelRegion

public NFRegion getBarValueLabelRegion()
Get the text background style to use for labeling bars in this barset.

Returns:
text background style.

setZAxisLabels

public void setZAxisLabels(NFModalLabel zAxisLabel)
Set the text style and value to use for labeling the Z Axis.

Parameters:
zAxisLabel - Text style and value

getZAxisLabels

public NFModalLabel getZAxisLabels()
Returns the text style and value to use for labeling the Z Axis.

Returns:
text style or null if not defined

setBarAnimationStyle

public void setBarAnimationStyle(int style)
Set the bar animation style.

If the value passed is not a valid bar animation style, BAR_ANIMATION_STYLE_NONE will be used.

Parameters:
style - One of BAR_ANIMATION_STYLE_NONE (default), BAR_ANIMATION_STYLE_GROW or BAR_ANIMATION_STYLE_FADE

getBarAnimationStyle

public int getBarAnimationStyle()
Get the bar animation style.

Returns:
type One of BAR_ANIMATION_STYLE_NONE (default), BAR_ANIMATION_STYLE_GROW or BAR_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