NetCharts Pro

netcharts.pro.charts.bar
Class NFBarchart

java.lang.Object
  |
  +--netcharts.pro.common.NFGraph
        |
        +--netcharts.pro.common.zoomable.NFZoomableChart
              |
              +--netcharts.pro.common.rectangular.NFDataChart
                    |
                    +--netcharts.pro.charts.bar.NFBarchart
All Implemented Interfaces:
java.io.Externalizable, NFDragObserver, NFDwellObserver, NFGraphObserver, NFScrollObserver, java.io.Serializable

public class NFBarchart
extends NFDataChart

Barchart object. Provides the ability to configure the chart via object manipulation or directly from CDL.

See Also:
Serialized Form

Field Summary
static java.util.Hashtable barchartTypeMap
          barchart type hashtable
static int GROUP
          Group 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 stackTypeMap
          barchart stack type hashtable
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.zoomable.NFZoomableChart
NOZOOM, zoomActionsMap, ZOOMIN, ZOOMOUT
 
Fields inherited from class netcharts.pro.common.NFGraph
BAR, BOX, BUBBLE, COMBO, DIAGRAM, DIAL, LINE, PIE, RADAR, STOCK, STRIP, TIME, XY
 
Constructor Summary
NFBarchart()
          Constructs a default chart object.
NFBarchart(javax.swing.JPanel panel)
          Constructs a chart object on the given JPanel.
NFBarchart(javax.swing.JPanel panel, java.util.Properties initProperties)
          Constructs a chart object on the given JPanel.
NFBarchart(java.util.Properties initProperties)
          Constructs a chart object on the given JPanel.
 
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.
 NFLine getBarBorder()
          Get barBorder for this bar chart
 int getBarchartType()
          Get barchart type, either GROUP (default), STACK, or ROWS.
 NFBarSeries getBarSeries()
          Get the bar 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 getDataLabels()
          Get the labels to be displayed under each bar.
 java.lang.String getDefaultData()
          Returns a string of default data
 int getDepth()
          Get 3DDepth
 int getOrientation()
          Get bar orientation, either VERTICAL (default) or HORIZONTAL
 int getStackType()
          Get barchart stack type, either TOTAL or ITEM.
 int getType()
          Gets the chart type.
 NFModalLabel getZAxisLabels()
           
 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 setBarBorder(NFLine barBorder)
          Set border for this bar chart
 void setBarchartType(int type)
          Set barchart type, either GROUP (default), STACK, or ROWS.
 void setBarSeries(NFBarSeries barSeries)
          Set the bar 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 setDataLabels(NFVector dataLabels)
          Set the labels to be displayed under each bar.
 void setDepth(int depth)
          Set 3DDepth
 void setOrientation(int orientation)
          Set bar orientation, either VERTICAL (default) or HORIZONTAL.
 void setStackType(int stackType)
          Set barchart stack type, either TOTAL or ITEM.
 void setZAxisLabels(NFModalLabel zAxisLabel)
           
 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, getAxesSizes, getAxisThickness, getBottomAxis, getBottomAxisSeries, getGrid, getGridDepth, getGridSeries, getLeftAxis, getLeftAxisSeries, getRightAxis, getRightAxisSeries, getTopAxis, getTopAxisSeries, setAxesSizes, setAxisThickness, setBottomAxis, setBottomAxisSeries, setGrid, 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
 
Methods inherited from class netcharts.pro.common.NFGraph
addChartActionListener, addGraphObserver, addNote, addPropertyChangeListener, display, dwellDisplay, dwellPress, finalize, getActiveClicks, getAlwaysUpdate, getAntiAlias, getBackgroundFillPattern, getBackgroundRegion, getCDL, getChartElementSpacing, getChartName, getChartSize, getColorTable, getDataActiveLabelsEnabled, getDwell, getDwellOffset, getErrors, getFooter, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphFromTemplate, getGraphGraphics, getHeader, getLeftTitle, getLegend, getMetaData, getMinimumSize, getNoteSeries, getNumberFormat, getNumErrors, getPanel, getPlotArea, getPreferredSize, getRightTitle, getRootPanel, getScaleFactor, 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, setBackgroundFillPattern, setBackgroundRegion, setChartElementSpacing, setChartName, setChartSize, setColorTable, setDataActiveLabelsEnabled, setDocumentBase, setDwell, setDwellOffset, setFooter, setHeader, setLeftTitle, setLegend, setLicenseKey, setMetaData, setNoteSeries, setNumberFormat, setParentApplet, setPlotArea, setRightTitle, setScaleFactor, setSize, setSize, 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

STACK

public static final int STACK
Stacked barchart type

GROUP

public static final int GROUP
Group barchart type

TOTAL

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

ITEM

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

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
Constructor Detail

NFBarchart

public NFBarchart()
Constructs a default chart object.

NFBarchart

public NFBarchart(javax.swing.JPanel panel)
Constructs a chart object on the given JPanel.
Parameters:
panel - Panel to draw chart on.

NFBarchart

public NFBarchart(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.

NFBarchart

public NFBarchart(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.
Method Detail

getDefaultData

public java.lang.String getDefaultData()
Returns a string of default data
Overrides:
getDefaultData in class NFGraph

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()
Get barBorder for this bar chart
Returns:
barBorder The line style to use for the bar border

setDepth

public void setDepth(int depth)
Set 3DDepth
Parameters:
depth - 3D shadow depth

getDepth

public int getDepth()
Get 3DDepth
Returns:
depth 3D shadow depth

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 -  

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

setOrientation

public void setOrientation(int orientation)
Set bar orientation, either VERTICAL (default) or HORIZONTAL.

If the value passed is not a valid format type, VERTICAL will be used.

Parameters:
orientation - One of HORIZONTAL, VERTICAL

getOrientation

public int getOrientation()
Get bar orientation, either VERTICAL (default) or HORIZONTAL
Returns:
orientation One of HORIZONTAL, VERTICAL

setBarchartType

public void setBarchartType(int type)
Set barchart type, either GROUP (default), STACK, or ROWS.

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

Parameters:
type - One of GROUP, STACK, or ROWS

getBarchartType

public int getBarchartType()
Get barchart type, either GROUP (default), STACK, or ROWS.
Returns:
type One of GROUP, STACK, or ROWS

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

setDataLabels

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

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

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.

getType

public int getType()
Gets the chart type.
Overrides:
getType in class NFGraph
Returns:
the type of this chart, always netcharts.pro.charts.bar.NFGraph.BAR

setZAxisLabels

public void setZAxisLabels(NFModalLabel zAxisLabel)

getZAxisLabels

public NFModalLabel getZAxisLabels()

writeExternal

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

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.
15825 Shady Grove Rd.
Suite 20
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2004
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: Apr 1, 2004