com.jinsight.jetchart
Class GraphSet

java.lang.Object
  |
  +--com.jinsight.jetchart.GraphSet

public class GraphSet
extends java.lang.Object

A GraphSet is a subset of all series added to the chart context. It is used to group series separately and plot them against independent scales, allowing for multiple scales to be displayed in a single chart.
Each GraphSet object creates and gives access to the following types of objects:

  1. - XAxis - provides properties and methods of a horizontal axis.
  2. - YAxis - provides properties and methods of a vertical axis.
  3. - Wall - provides properties and methods to paint the background of a GraphSet area.
  4. - ScrollingBar - provides properties and methods of a scrolling bar.
  5. - Scale - provides properties and methods of a scale.
  6. - Grid - provides properties and methods of a grid.
  7. - GridCrossedLines - provides properties and methods of the lines that cross the grid perpendicularly.
  8. - SeriesBase - provides properties and methods of a series base. A series base is a line drawn across the chart area starting at the 'zero' scale value to help identify the positive and negative chart regions.
  9. - TargetLine - A target line is an indicator associated with a value representing a limit to be avoided or a goal to achieve.

Series grouped in a GraphSet are plotted against that GraphSet's scale. Any number of GraphSet objects can be created and added to the chart context, each of them owning a set of the objects above listed.

Horizontal charts do not support multiple scales, even if more than one GraphSet is added to the chart context. Series belonging to different GraphSets are relocated to the primary GraphSet, explained below.

JetChart has a default, or primary GraphSet, to hold all series that are not included in any other GraphSet. GraphSet objects are sequentially assigned an id number, starting from '1', which follows the sequence they are added to the chart context. The id '0' is reserved to the primary GraphSet object.

A GraphSet can only hold distinct series. If two references of the same series are detected, an exception is raised.

All series included in GraphSet objects must also be added to the chart context, using the addSerie method of the Graph class. If any GraphSet is keeping references to series not added to the chart context, an exception is raised.

See Also:
Graph.addSerie(com.jinsight.jetchart.AbstractSerie), Graph.addGraphSet(com.jinsight.jetchart.GraphSet), Graph.removeGraphSet(com.jinsight.jetchart.GraphSet), Graph.getGraphSet(int), Scale, Grid, SeriesBase, Axis, XAxis, YAxis, GridCrossedLines, Wall, ScrollingBar, TargetLine

Constructor Summary
GraphSet()
          Creates a GraphSet object.
 
Method Summary
 void addSerie(GraphSerie gs)
          Adds a series.
 void addTargetLine(TargetLine tl)
          Adds a target line.
 void addTargetZone(TargetZone tz)
          Adds a target zone.
protected  void finalize()
           
 Grid getGrid()
          Returns a reference to the Grid object of this GraphSet.
 GridCrossedLines getGridCrossedLines()
          Returns a reference to the GridCrossedLines object of this GraphSet.
 YAxis getRYAxis()
          Returns a reference to the right YAxis object of this GraphSet.
 Scale getScale()
          Returns a reference to the Scale object of this GraphSet.
 ScrollingBar getScrollingBar()
          Returns a reference to the ScrollingBar object of this GraphSet.
 int getSerieIndex(GraphSerie gs)
          Gets an index of a series already added to GraphSet.
 java.util.Vector getSeries()
          Returns a collection of references to series added to this GraphSet object.
 SeriesBase getSeriesBase()
          Returns a reference to the SeriesBase object of this GraphSet.
 java.util.Vector getTargetLines()
          Returns a collection of references to target lines added to this GraphSet object.
 java.util.Vector getTargetZones()
          Returns a collection of references to target zones added to this GraphSet object.
 Wall getWall()
          Returns a reference to the Wall object of this GraphSet
 XAxis getXAxis()
          Returns a reference to the XAxis object of this GraphSet.
 YAxis getYAxis()
          Returns a reference to the left YAxis object of this GraphSet.
 void removeAllSeries()
          Removes all series.
 void removeAllTargetLines()
          Removes all target lines.
 void removeAllTargetZones()
          Removes all target zones.
 void removeAllTrendLines()
          Removes all trendlines manually painted and owned by this GraphSet.
 void removeSerie(GraphSerie gs)
          Removes a series.
 void removeTargetLine(TargetLine tl)
          Removes a target line.
 void removeTargetZone(TargetZone tz)
          Removes a target zone.
 void setLabelsColor(java.awt.Color labelsColor)
          Sets the labels color.
 void setLabelsEnabled(boolean isLabelsEnabled)
          Enables/disables labels.
 void setLabelsMarksColor(java.awt.Color labelsMarksColor)
          Sets labels marks color.
 void setLabelsMarksEnabled(boolean isLabelsMarksEnabled)
          Enables/disables labels marks.
 void setTrendLinesColor(java.awt.Color trendLinesColor)
          Sets the color of all trendlines owned by this GraphSet.
 void setTrendLinesThickness(int trendLinesThickness)
          Sets the thickness of all trendlines owned by this GraphSet.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphSet

public GraphSet()
Creates a GraphSet object. Default constructor.
Method Detail

addSerie

public void addSerie(GraphSerie gs)
Adds a series.
Parameters:
gs - A GraphSerie object.
See Also:
GraphSerie

removeSerie

public void removeSerie(GraphSerie gs)
Removes a series.
Parameters:
gs - A GraphSerie object.
See Also:
GraphSerie

removeAllSeries

public void removeAllSeries()
Removes all series.

addTargetLine

public void addTargetLine(TargetLine tl)
Adds a target line.
Parameters:
tl - A TargetLine object.
See Also:
TargetLine

removeTargetLine

public void removeTargetLine(TargetLine tl)
Removes a target line.
Parameters:
tl - A TargetLine object.
See Also:
TargetLine

removeAllTargetLines

public void removeAllTargetLines()
Removes all target lines.
See Also:
TargetLine

addTargetZone

public void addTargetZone(TargetZone tz)
Adds a target zone.
Parameters:
tz - A TargetZone object.
See Also:
TargetZone

removeTargetZone

public void removeTargetZone(TargetZone tz)
Removes a target zone.
Parameters:
tz - A TargetZone object.
See Also:
TargetZone

removeAllTargetZones

public void removeAllTargetZones()
Removes all target zones.
See Also:
TargetZone

getSerieIndex

public int getSerieIndex(GraphSerie gs)
Gets an index of a series already added to GraphSet.
Parameters:
gs - A GraphSerie object.
See Also:
GraphSerie

getSeries

public java.util.Vector getSeries()
Returns a collection of references to series added to this GraphSet object. If this GraphSet does not have any series this method returns null.
Returns:
A Vector object.
See Also:
GraphSerie

getTargetLines

public java.util.Vector getTargetLines()
Returns a collection of references to target lines added to this GraphSet object. If this GraphSet does not have any target lines, this method returns null.
Returns:
A Vector object.
See Also:
TargetLine

getTargetZones

public java.util.Vector getTargetZones()
Returns a collection of references to target zones added to this GraphSet object. If this GraphSet does not have any target zones, this method returns null.
See Also:
TargetZone

getSeriesBase

public SeriesBase getSeriesBase()
Returns a reference to the SeriesBase object of this GraphSet.
Returns:
SeriesBase object.
See Also:
SeriesBase

getGrid

public Grid getGrid()
Returns a reference to the Grid object of this GraphSet.
Returns:
Grid object
See Also:
Grid

getScale

public Scale getScale()
Returns a reference to the Scale object of this GraphSet.
Returns:
Scale object
See Also:
Scale

getXAxis

public XAxis getXAxis()
Returns a reference to the XAxis object of this GraphSet.
Returns:
XAxis object.
See Also:
XAxis

getYAxis

public YAxis getYAxis()
Returns a reference to the left YAxis object of this GraphSet.
Returns:
YAxis object.
See Also:
YAxis

getRYAxis

public YAxis getRYAxis()
Returns a reference to the right YAxis object of this GraphSet. The right y axis is only displayed if any GraphSet scale position is set to the right side and the chart is vertical.
Returns:
YAxis object.
See Also:
YAxis, GraphSet, Scale

getWall

public Wall getWall()
Returns a reference to the Wall object of this GraphSet
Returns:
Wall object.
See Also:
Wall, Graph.getWall()

getGridCrossedLines

public GridCrossedLines getGridCrossedLines()
Returns a reference to the GridCrossedLines object of this GraphSet.
Returns:
GridCrossedLines object.
See Also:
GridCrossedLines

getScrollingBar

public ScrollingBar getScrollingBar()
Returns a reference to the ScrollingBar object of this GraphSet.
Returns:
ScrollingBar object.
See Also:
ScrollingBar

setLabelsEnabled

public void setLabelsEnabled(boolean isLabelsEnabled)
Enables/disables labels. The labels axis can be either the y axis or x axis, depending on chart orientation(vertical/horizontal).
Parameters:
isLabelsEnabled - A boolean value(true/false).

setLabelsColor

public void setLabelsColor(java.awt.Color labelsColor)
Sets the labels color.
Parameters:
labelsColor - A Color object.

setLabelsMarksEnabled

public void setLabelsMarksEnabled(boolean isLabelsMarksEnabled)
Enables/disables labels marks.
Parameters:
isLabelsMarksEnabled - A boolean value(true/false)

setLabelsMarksColor

public void setLabelsMarksColor(java.awt.Color labelsMarksColor)
Sets labels marks color.
Parameters:
labelsMarksColor - A Color object.

setTrendLinesColor

public void setTrendLinesColor(java.awt.Color trendLinesColor)
Sets the color of all trendlines owned by this GraphSet. Trend lines color is black by default.
Parameters:
trendLinesColor -  
See Also:
Graph.setTrendLinesDrawingEnabled(boolean)

setTrendLinesThickness

public void setTrendLinesThickness(int trendLinesThickness)
Sets the thickness of all trendlines owned by this GraphSet. Trend lines thickness is 1 by default.
Parameters:
trendLinesThickness - An integer number equal to or greater than 1.
See Also:
Graph.setTrendLinesDrawingEnabled(boolean)

removeAllTrendLines

public void removeAllTrendLines()
Removes all trendlines manually painted and owned by this GraphSet.
See Also:
Graph.setTrendLinesDrawingEnabled(boolean)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object