JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class ChartDataViewSeries

java.lang.Object
  |
  +--com.klg.jclass.chart.ChartDataViewSeries
All Implemented Interfaces:
com.klg.jclass.util.JCName, Serializable

public class ChartDataViewSeries
extends Object
implements Serializable, com.klg.jclass.util.JCName

Class representing a single data series. While ChartDataView manages multiple data series, ChartDataViewSeries contains the data for a single data series. The data is stored as two arrays of X and Y values.
Note: If the X data array is null or empty, the X data array in ChartDataView is used (this interpretation used to be known as array format).

See Also:
Serialized Form

Field Summary
protected static int dataViewSeriesNum
           
protected  int drawingOrder
           
protected  int firstPoint
           
protected  boolean included
           
protected  String label
           
protected  com.klg.jclass.chart.DerivedInt lastPoint
           
protected  com.klg.jclass.util.ImageMapInfo legendImageMapInfo
           
protected  Locale locale
           
protected  String name
           
protected  com.klg.jclass.chart.ChartDataView parent
           
protected  com.klg.jclass.util.ImageMapInfo[] pointImageMapInfo
           
protected  com.klg.jclass.util.ImageMapInfo seriesImageMapInfo
           
protected  boolean visible
           
protected  boolean visibleInLegend
           
 
Constructor Summary
ChartDataViewSeries()
          Basic constructor.
 
Method Summary
protected  void calcStep(com.klg.jclass.chart.ChartDataView cdv)
           
 void editPoint(int index, double newValue)
          Used to change the Y value of some point in the series.
 int getDrawingOrder()
          Gets the value of the DrawingOrder property.
 int getFirstPoint()
          Retrieves the index of the first point in the specified series.
 String getLabel()
          Gets the Label property of the data series.
 int getLastPoint()
          Retrieves the index of the last point in the specified series.
 boolean getLastPointIsDefault()
          Gets the LastPointIsDefault property of ChartDataViewSeries.
 com.klg.jclass.util.ImageMapInfo getLegendImageMapInfo()
          Gets the legend image map information for this series.
protected  Locale getLocale()
          Retrieve the local for this axis.
 String getName()
          Gets the value of the Name property.
 com.klg.jclass.chart.ChartDataView getParent()
          Gets the value of the Parent property.
protected  int getPoint(double v, double[] arr)
          Finds the closest match to a value in an array.
 com.klg.jclass.util.ImageMapInfo[] getPointImageMapInfo()
          Retrieves an array of image map information, one for each point in the series.
 com.klg.jclass.util.ImageMapInfo getSeriesImageMapInfo()
          Gets the image map information for this series.
 com.klg.jclass.chart.JCChartStyle getStyle()
          Gets the Style property for this ChartDataViewSeries, which defines the rendering style for the data series.
protected  double[] getX()
           
 int getX(double x)
          Returns the index that contains the value closest to the specified X value.
 double getX(int i)
          Returns the X value at the specified index.
 double[] getXArrayCopy()
          Gets a copy of the X values array in this data series.
protected  void getXMinMax(com.klg.jclass.chart.MinMax x)
           
protected  double[] getY()
           
 int getY(double y)
          Returns the index that contains the value closest to the specified Y value.
 double getY(int i)
          Returns the Y value at the specified index.
 double[] getYArrayCopy()
          Gets a copy of the Y values array in this data series.
protected  void getYMinMax(com.klg.jclass.chart.MinMax y)
           
 boolean isIncluded()
          Gets the value of the IsIncluded property.
 boolean isVisible()
          Gets the value of the Visible property.
 boolean isVisibleInLegend()
          Gets the VisibleInLegend property.
 int maxIndex()
          Gets the maximum of the X and Y indices.
 int maxXIndex()
          Gets the maximum X index.
 int maxYIndex()
          Gets the maximum Y index.
 void setDrawingOrder(int neword)
          Sets the value of the DrawingOrder property.
 void setFirstPoint(int point)
          Sets the index of the first point in the specified series.
 void setIncluded(boolean inc)
          Sets the value of the IsIncluded property.
 void setLabel(String lab)
          Sets the Label property of the data series.
 void setLastPoint(int point)
          Sets the index of the last point in the specified series.
 void setLastPointIsDefault(boolean b)
          Sets the LastPointIsDefault property of ChartDataViewSeries.
 void setLegendImageMapInfo(com.klg.jclass.util.ImageMapInfo legendImageMapInfo)
          Sets the legend image map information for this series.
protected  void setLocale(Locale locale)
          Set the locale for this axis.
 void setName(String nm)
          Sets the value of the Name property.
 void setPointImageMapInfo(com.klg.jclass.util.ImageMapInfo[] pointImageMapInfo)
          Sets an array of image map information, one for each point in the series.
 void setSeriesImageMapInfo(com.klg.jclass.util.ImageMapInfo seriesImageMapInfo)
          Sets the image map information for this series.
 void setStyle(com.klg.jclass.chart.JCChartStyle st)
          Sets the Style property for this ChartDataViewSeries, which defines the rendering style for the data series.
 void setVisible(boolean shn)
          Sets the value of the Visible property.
 void setVisibleInLegend(boolean vil)
          Sets the VisibleInLegend property.
protected  void setX(double[] x)
           
protected  void setY(double[] y)
           
 String toString()
          Returns a String representation of this series.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected com.klg.jclass.chart.ChartDataView parent

firstPoint

protected int firstPoint

lastPoint

protected com.klg.jclass.chart.DerivedInt lastPoint

name

protected String name

drawingOrder

protected int drawingOrder

visible

protected boolean visible

visibleInLegend

protected boolean visibleInLegend

included

protected boolean included

label

protected String label

pointImageMapInfo

protected com.klg.jclass.util.ImageMapInfo[] pointImageMapInfo

seriesImageMapInfo

protected com.klg.jclass.util.ImageMapInfo seriesImageMapInfo

legendImageMapInfo

protected com.klg.jclass.util.ImageMapInfo legendImageMapInfo

locale

protected Locale locale

dataViewSeriesNum

protected static int dataViewSeriesNum
Constructor Detail

ChartDataViewSeries

public ChartDataViewSeries()
Basic constructor. Parent and data arrays are set to null.

Method Detail

setLocale

protected void setLocale(Locale locale)
Set the locale for this axis.


getLocale

protected Locale getLocale()
Retrieve the local for this axis.


editPoint

public void editPoint(int index,
                      double newValue)
Used to change the Y value of some point in the series. Informs the ChartDataView, which in turn informs the external data object.

Parameters:
index - the index with the Y array
newValue - the new edited Y value

getFirstPoint

public int getFirstPoint()
Retrieves the index of the first point in the specified series. FirstPoint and LastPoint can be used to constrain the data that is displayed.

Returns:
index of the first point of the series that will be displayed

setFirstPoint

public void setFirstPoint(int point)
Sets the index of the first point in the specified series. FirstPoint and LastPoint can be used to constrain the data that is displayed.

Parameters:
point - new first point number
Throws:
IllegalArgumentException - If the provided index does not address a point in the data series.

getLastPoint

public int getLastPoint()
Retrieves the index of the last point in the specified series. FirstPoint and LastPoint can be used to constrain the data that is displayed.

Returns:
index of the last point in the series that will be displayed

getLastPointIsDefault

public boolean getLastPointIsDefault()
Gets the LastPointIsDefault property of ChartDataViewSeries. This property determines whether chart is responsible for calculating the LastPoint property itself or if the current value of the LastPoint property should be used.

Returns:
value of LastPointIsDefault property; default is true

setLastPoint

public void setLastPoint(int point)
Sets the index of the last point in the specified series. FirstPoint and LastPoint can be used to constrain the data that is displayed.

Parameters:
point - new last point index
Throws:
IllegalArgumentException - If the provided index does not address a point in the data series.

setLastPointIsDefault

public void setLastPointIsDefault(boolean b)
Sets the LastPointIsDefault property of ChartDataViewSeries. It determines whether chart is responsible for calculating the LastPoint property itself or if the current value of the LastPoint property should be used.

Parameters:
b - if true, calculates the LastPoint property; if false, uses the current value of the LastPoint property

getName

public String getName()
Gets the value of the Name property. The Name property represents the name of the data series. In JClass Chart, data series are named, and can be retrieved by name.

Specified by:
getName in interface com.klg.jclass.util.JCName
Returns:
series name
See Also:
ChartDataView

setName

public void setName(String nm)
Sets the value of the Name property. The Name property represents the name of the data series. In JClass Chart, data series are named, and can be retrieved by name.

Specified by:
setName in interface com.klg.jclass.util.JCName
Parameters:
nm - the new name
See Also:
ChartDataView

getParent

public com.klg.jclass.chart.ChartDataView getParent()
Gets the value of the Parent property. The Parent property points to the containing ChartDataView for this ChartDataView series.

Returns:
the current ChartDataView parent

getStyle

public com.klg.jclass.chart.JCChartStyle getStyle()
Gets the Style property for this ChartDataViewSeries, which defines the rendering style for the data series.

Returns:
JCChartStyle instance that specifies how to render the data series

setStyle

public void setStyle(com.klg.jclass.chart.JCChartStyle st)
Sets the Style property for this ChartDataViewSeries, which defines the rendering style for the data series.

Parameters:
st - JCChartStyle instance that specifies how to render the data series

getDrawingOrder

public int getDrawingOrder()
Gets the value of the DrawingOrder property. The DrawingOrder property determines the order of display of data series. When the DrawingOrder property is changed, ChartDataView will normalize the order properties of all of the ChartDataViewSeries objects that it manages.

Returns:
DrawingOrder for this ChartDataViewSeries item.

setDrawingOrder

public void setDrawingOrder(int neword)
Sets the value of the DrawingOrder property. The DrawingOrder property determines the order of display of data series. When the DrawingOrder property is changed, ChartDataView will normalize the order properties of all the ChartDataViewSeries objects that it manages.

Parameters:
neword - DrawingOrder for this ChartDataViewSeries item
Throws:
IllegalArgumentException - If the order value provided does not address a data series.

isVisible

public boolean isVisible()
Gets the value of the Visible property. The Visible property determines whether the data series is showing in the chart area.
Note: Data series that are not showing are still used in axis calculations. See the IsIncluded property for details on how to omit a data series from chart calculations.

Returns:
true if the data series is showing; false otherwise

setVisible

public void setVisible(boolean shn)
Sets the value of the Visible property. The Visible property determines whether the data series is showing in the chart area.
Note: Data series that are not showing are still used in axis calculations. See the IsIncluded property for details on how to omit a data series from chart calculations.

Parameters:
shn - true if the data series is showing; false otherwise

isVisibleInLegend

public boolean isVisibleInLegend()
Gets the VisibleInLegend property. This property determines whether or not this series will appear in the chart legend.

Returns:
true if the series will appear in the legend

setVisibleInLegend

public void setVisibleInLegend(boolean vil)
Sets the VisibleInLegend property. This property determines whether or not this series will appear in the chart legend.

Parameters:
vil - the new value of VisibleInLegend

isIncluded

public boolean isIncluded()
Gets the value of the IsIncluded property. The IsIncluded property determines whether a data series is included in chart calculations (like axis bounds).

Returns:
true if the data series is included; false otherwise

setIncluded

public void setIncluded(boolean inc)
Sets the value of the IsIncluded property. The IsIncluded property determines whether a data series is included in chart calculations (like axis bounds).

Parameters:
inc - true if the data series is included; false otherwise

setLabel

public void setLabel(String lab)
Sets the Label property of the data series. The Label property controls the text that appears next to the data series inside the legend. It can be unparsed HTML text.

Parameters:
lab - the new label

getLabel

public String getLabel()
Gets the Label property of the data series. The Label property controls the text that appears next to the data series inside the legend.

Returns:
Label information

getPointImageMapInfo

public com.klg.jclass.util.ImageMapInfo[] getPointImageMapInfo()
Retrieves an array of image map information, one for each point in the series.

Returns:
The current point image map information array.

setPointImageMapInfo

public void setPointImageMapInfo(com.klg.jclass.util.ImageMapInfo[] pointImageMapInfo)
Sets an array of image map information, one for each point in the series.

Parameters:
pointImageMapInfo - The new point image map information array.

getSeriesImageMapInfo

public com.klg.jclass.util.ImageMapInfo getSeriesImageMapInfo()
Gets the image map information for this series.

Returns:
The current image map information for this series.

setSeriesImageMapInfo

public void setSeriesImageMapInfo(com.klg.jclass.util.ImageMapInfo seriesImageMapInfo)
Sets the image map information for this series.

Parameters:
seriesImageMapInfo - The new image map information for this series.

getLegendImageMapInfo

public com.klg.jclass.util.ImageMapInfo getLegendImageMapInfo()
Gets the legend image map information for this series.

Returns:
The current legend image map information for this series.

setLegendImageMapInfo

public void setLegendImageMapInfo(com.klg.jclass.util.ImageMapInfo legendImageMapInfo)
Sets the legend image map information for this series.

Parameters:
legendImageMapInfo - The new legend image map information for this series.

toString

public String toString()
Returns a String representation of this series. If it has a name, it is used.

Overrides:
toString in class Object
Returns:
a String representation of this series

maxXIndex

public int maxXIndex()
Gets the maximum X index.

Returns:
the current maximum X index

maxYIndex

public int maxYIndex()
Gets the maximum Y index.

Returns:
the current maximum Y index

maxIndex

public int maxIndex()
Gets the maximum of the X and Y indices.

Returns:
the current maximum of the X and Y indices

getXMinMax

protected void getXMinMax(com.klg.jclass.chart.MinMax x)

calcStep

protected void calcStep(com.klg.jclass.chart.ChartDataView cdv)

getYMinMax

protected void getYMinMax(com.klg.jclass.chart.MinMax y)

getX

public double getX(int i)
Returns the X value at the specified index.

Parameters:
i - the index of the value wanted
Returns:
the X value at the specified index

getY

public double getY(int i)
Returns the Y value at the specified index.

Parameters:
i - the index of the value wanted
Returns:
the Y value at the specified index

getX

protected double[] getX()

getY

protected double[] getY()

getXArrayCopy

public double[] getXArrayCopy()
Gets a copy of the X values array in this data series.

Returns:
a new array containing a copy of the X values array

getYArrayCopy

public double[] getYArrayCopy()
Gets a copy of the Y values array in this data series.

Returns:
a new array containing a copy of the Y values array

setX

protected void setX(double[] x)

setY

protected void setY(double[] y)

getX

public int getX(double x)
Returns the index that contains the value closest to the specified X value.

Parameters:
x - the value to check against
Returns:
the closest index to X

getY

public int getY(double y)
Returns the index that contains the value closest to the specified Y value.

Parameters:
y - the value to check against
Returns:
the closest index to Y

getPoint

protected int getPoint(double v,
                       double[] arr)
Finds the closest match to a value in an array.

Parameters:
v - the value to check
arr - the array to check against
Returns:
the index of the closest match

Copyright © 2004 Quest Software Inc..
All rights reserved.