All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.chart.ChartDataView

java.lang.Object
   |
   +----jclass.chart.ChartDataView

public class ChartDataView
extends Object
implements Observer, Changeable, JCSerializable, HTMLHandler
ChartDataView contains the internal representation of the chartable data. Chart data is represented as a series of ChartDataViewSeries objects managed by a ChartDataView object. Note that ChartDataView includes a mapping from series number to series name.

A ChartDataView object can optionally be connected to a ChartDataModel object. If it is connected, ChartDataView becomes a view on the ChartDataModel, and it relies on the ChartDataModel for all chartable data. If it is not connected, ChartDataView will store the data internally.

A ChartDataView can also connect itself to a Chartable or EditableChartable object. ChartDataView is smart enough to figure out if it is being given an Observable, and will connect itself as an Observer.

ChartDataView also manages the JCChartStyles for the data series. By default, if no JCChartStyle is provided by the developer, ChartDataView will create a default JCChartStyle for the data series.

Note that this means that ChartDataView is not always a view - it is capable of being a view, but that does not mean that it is necessarily a view.

Properties

Name Description
AutoLabel The AutoLabel property determines if the chart automatically generates labels for each point in each series. The default is false. The labels are stored in the AutoLabelList property. They are created using the Label property of each series.
AutoLabelList The AutoLabelList property is a two-dimensional array of automatically-generated JCChartLabel instances, one for every point and series. The inner array is indexed by point; the outer array by series. Default is empty.
BarChartFormat The BarChartFormat property represents the JCBarChartFormat for the ChartDataView instance. Unless the ChartType property is a bar chart, the BarChartFormat property is null.
BufferPlotData The BufferPlotData property controls whether plot data are to be buffered to speed up the drawing process. This property is applicable for Plot, Scatter, Area, Hilo, HLOC, and Candle chart types only. Normally it is true. The property is ignored if the FastUpdate property is true. Plot data will be buffered for FastUpdate.
CandleChartFormat The CandleChartFormat property represents the JCCandleChartFormat for the ChartDataView instance. Unless the ChartType property is a candle chart, the CandleChartFormat property is null.
Changed The Changed property manages whether the data view requires recalculation. If set to true, a recalculation may be triggered. Default value is true.
ChartStyle The ChartStyle property contains all the ChartStyles for the data series in this data view. Default value is generated.
ChartType The ChartType property of the ChartData object specifies the type of chart used to plot the data. Valid values are: JCChart.AREA, JCChart.BAR, JCChart.CANDLE, JCChart.HILO, JCChart.HILO_OPEN_CLOSE, JCChart.PIE, JCChart.PLOT (default), JCChart.SCATTER_PLOT, and JCChart.STACKING_BAR.
DataSource The DataSource property, if non-null, is used as a source for data in the ChartDataView. The DataSource can refer to an object that implements Chartable or EditableChartable, or it can refer to an object that extends the abstract class ChartDataModel. JCChart will do the "right thing" based on the object provided.
DrawingOrder The DrawingOrder property determines the drawing order of items. When the DrawingOrder property is changed, the order properties of all ChartDataView instances managed by a single JCChart object are normalized.
FastUpdate The FastUpdate property controls whether column appends to the data are performed quickly, only recalculating and redrawing the newly-appended data.
HiloChartFormat The HiloChartFormat property represents the JCHiloChartFormat for the ChartDataView instance. Unless the ChartType property is a HiLo chart, the HiloChartFormat property is null.
HLOCChartFormat The HLOCChartFormat property represents the JCHLOCChartFormat for the ChartDataView instance. Unless the ChartType property is a HiLoOpenClose chart, the HLOCChartFormat property is null.
HoleValue The HoleValue property is a floating point number used to represent a hole in the data. Internally, ChartDataView places this value in the x and y arrays to represent a missing data value.
IsBatched The IsBatched property controls whether the ChartDataView is notified immediately of data source changes, or if the changes are accumulated and sent at a later date.
IsInverted If the IsInverted property is set to true, the x axis becomes vertical, and the y axis becomes horizontal. Default value is false.
IsShowing The IsShowing property determines whether the dataview is showing or not. Default value is true.
IsShowingInLegend The IsShowingInLegend property determines whether or not the view name and its series will appear in the chart legend.
Name The Name property is used as an index for referencing particular ChartDataView objects.
OutlineColor The OutlineColor property determines the color with which to draw the outline around a filled chart item (e.g. bar, pie).
PickFocus The PickFocus property specifies how distance is determined for pick operations. When set to PICK_FOCUS_XY, a pick operation will use the actual distance between the point and the drawn data. When set to values of PICK_FOCUS_X or PICK_FOCUS_Y, the distance only along the X or Y axis is used.
PieChartFormat The PieChartFormat property represents the JCPieChartFormat for the ChartDataView instance. Unless the ChartType property is a pie chart, the PieChartFormat property is null.
PointLabels The PointLabels property is an indexed property consisting of a series of strings representing the desired label for a particular data point.
Series The Series property is an indexed property that contains all data series for a particular ChartDataView. The order of ChartDataViewSeries objects in the series array corresponds to the drawing order.
XAxis The XAxis property determines the x axis against which the data in ChartDataView is plotted.
YAxis The YAxis property determines the y axis against which the data in ChartDataView is plotted.


Variable Index

 o chartType_strings
 o chartType_values
 o PICK_FOCUS_LOCAL
 o PICK_FOCUS_X
 o PICK_FOCUS_XY
 o PICK_FOCUS_Y
 o series

Constructor Index

 o ChartDataView()

Method Index

 o addSeries(ChartDataViewSeries)
Adds a ChartDataViewSeries to the view at the end of the list.
 o addSeries(int)
Adds a data series to the Series property at the specified index.
 o calcTransientData()
 o checkNewPoints(int)
Checks newly added points to see if they fit inside current axis bounds.
 o coordToDataCoord(int, int)
Same as map().
 o coordToDataIndex(int, int, int)
Similar to pick() for a specific data view.
 o dataCoordToCoord(double, double)
Same as unmap().
 o dataIndexToCoord(JCDataIndex)
Similar to unpick() for a specific data view.
 o getAutoLabel()
Gets the AutoLabel property, which determines if a chart automatically generates labels for each point in each series.
 o getAutoLabelList()
Gets the AutoLabelList property for the ChartDataView object.
 o getBarChartFormat()
Gets the value of the BarChartFormat property for the ChartDataView instance.
 o getBufferPlotData()
Gets the BufferPlotData property.
 o getCandleChartFormat()
Gets the value of the CandleChartFormat property for the ChartDataView instance.
 o getChanged()
 o getChanged(int)
 o getChartStyle()
Gets the value of the ChartStyle property.
 o getChartStyle(int)
Gets the value of the ChartStyle property.
 o getChartType()
Gets the ChartType property of the ChartData object, which determines how the chart data is plotted.
 o getDataSource()
Gets the DataSource property for ChartDataView.
 o getDrawingOrder()
Gets the DrawingOrder property.
 o getFastUpdate()
Gets the FastUpdate property.
 o getFirstLast()
Calculates the set of points to be covered by a bar chart by finding the largest FirstPoint value and the smallest LastPoint value.
 o getHiloChartFormat()
Gets the value of the HiloChartFormat property for the ChartDataView instance.
 o getHLOCChartFormat()
Gets the value of the HLOCChartFormat property for the ChartDataView instance.
 o getHoleValue()
Returns the hole value for the chart data.
 o getIsBatched()
Gets the IsBatched property.
 o getIsInverted()
Sets the IsInverted property of the data view.
 o getIsShowing()
Gets whether the dataview is showing or not
 o getIsShowingInLegend()
Gets the IsShowingInLegend property.
 o getName()
Gets the Name property of the ChartData object.
 o getNumPointLabels()
 o getNumSeries()
Gets the value of the NumSeries parameter, which determines how many data series there are in a ChartDataView.
 o getOutlineColor()
Gets the value of the OutlineColor property.
 o getPickFocus()
Gets the PickFocus property of the data view.
 o getPieChartFormat()
Gets the value of the PieChartFormat property for the ChartDataView instance.
 o getPointLabel(int)
Gets a particular PointLabel from the PointLabels property.
 o getPointLabels()
Gets the PointLabels property for the ChartDataView object.
 o getSeries()
Gets the value of the Series property for this ChartDataView instance.
 o getSeries(int)
Gets the value of the Series property at a particular index.
 o getSeriesIndex(ChartDataViewSeries)
A convenience method to retrieve a data series index given data series itself.
 o getSeriesIndex(String)
A convenience method to retrieve a data series index given the name of the data series.
 o getVisibleDataSeries()
 o getXAxis()
Gets the value of the XAxis property.
 o getXLimits()
 o getYAxis()
Gets the value of the YAxis property.
 o getYLimits()
 o isChanged()
 o isChanged(int)
 o loadParams(String, JCChart)
Load JCChart parameters from HTML file
 o map(int, int)
Performs a map operation by mapping the provided screen pixel information to data values along the x and y axes of the ChartDataView instance.
 o outputData(OutputStream)
Save the raw Data to the given output stream The data written should be readable by InputStreamDataSource
 o removeSeries(int)
Removes a single data series from the Series property of the ChartDataView instance.
 o saveParams(String, JCChart)
Save JCChart parameters as HTML tags
 o setAutoLabel(boolean)
Sets the AutoLabel property, which determines if a chart automatically generates labels for each point in each series.
 o setBufferPlotData(boolean)
Sets the BufferPlotData property.
 o setChanged(boolean, int)
Sets the value of the Changed property The Changed property manages whether the data view requires recalculation.
 o setChanged(boolean, int, boolean)
Sets the value of the Changed property, with option to prevent parent updating via the updateParent parameter.
 o setChartStyle(int, JCChartStyle)
Sets the value of the ChartStyle property.
 o setChartStyle(JCChartStyle[])
Sets the value of the ChartStyle property.
 o setChartType(int)
Sets the ChartType property of the ChartData object, which specifies the type of chart used to plot the data.
 o setDataSource(Chartable)
Sets the DataSource property for ChartDataView.
 o setDrawingOrder(int)
Sets the DrawingOrder property of the ChartDataView object.
 o setFastUpdate(boolean)
Sets the FastUpdate property.
 o setHoleValue(double)
Sets the hole value for the chart data.
 o setIsBatched(boolean)
Sets the IsBatched property.
 o setIsInverted(boolean)
Sets the IsInverted property of the data view.
 o setIsShowing(boolean)
Sets whether the dataview is showing or not
 o setIsShowingInLegend(boolean)
Sets the IsShowingInLegend property.
 o setName(String)
Sets the Name property of the ChartData object.
 o setOutlineColor(Color)
Sets the value of the OutlineColor property.
 o setPickFocus(int)
Sets the PickFocus property of the data view, which specifies how distance is determined for pick operations.
 o setPointLabel(int, String)
Sets a particular PointLabel from the PointLabels property.
 o setPointLabels(String[])
Sets the PointLabels property for the ChartDataView object.
 o setSeries(ChartDataViewSeries[])
Sets the value of the Series property for this ChartDataView instance.
 o setSeries(int, ChartDataViewSeries)
Sets the value of the Series property at a particular index.
 o setXAxis(JCAxis)
Sets the value of the XAxis property.
 o setYAxis(JCAxis)
Sets the value of the YAxis property.
 o toString()
Output routine used for debugging.
 o unmap(double, double)
Performs an unmap operation by taking floating-point x and y values meant to represent a point along the x and y axes of the data.
 o update(Observable, Object)
Callback routine from the dataModel.

Variables

 o series
 protected JCVector series
 o PICK_FOCUS_LOCAL
 public static final int PICK_FOCUS_LOCAL
 o PICK_FOCUS_XY
 public static final int PICK_FOCUS_XY
 o PICK_FOCUS_X
 public static final int PICK_FOCUS_X
 o PICK_FOCUS_Y
 public static final int PICK_FOCUS_Y
 o chartType_strings
 public static final String chartType_strings[]
 o chartType_values
 public static final int chartType_values[]

Constructors

 o ChartDataView
 public ChartDataView()

Methods

 o update
 public void update(Observable model,
                    Object arg)
Callback routine from the dataModel. When the dataModel has new data for ChartDataView, it will call this method.

Parameters:
model - model making the call
arg - argument passed by the model. Contains information on the change that has been made.
See Also:
ChartDataModelUpdate
 o checkNewPoints
 public boolean checkNewPoints(int npoints)
Checks newly added points to see if they fit inside current axis bounds.

Parameters:
npoints - the number of points to check. It refers to the number of points newly added to the end of all series.
Returns:
true if all points sit inside current axis bounds if those bounds are set to default values. false if any point sits outside a current axis bound that is set to a default value.
 o getHoleValue
 public double getHoleValue()
Returns the hole value for the chart data. The hole value is a floating point number used to represent a hole in the data. Internally, ChartData places this value in the x and y arrays to represent a missing data value.

Returns:
floating-point value used as a placeholder for missing values
 o setHoleValue
 public void setHoleValue(double val)
Sets the hole value for the chart data. The hole value is a floating point number used to represent a hole in the data. Internally, ChartData places this value in the x and y arrays to represent a missing data value. Changing the hole value entails replacing all the "current" holes with the new value.

Parameters:
val - floating-point value used as a placeholder for missing values
 o getIsBatched
 public boolean getIsBatched()
Gets the IsBatched property. ChartData is a model for the ChartGroup object. The IsBatched property controls whether the ChartGroup is notified immediately of ChartData changes, or if the changes are accumulated and sent at a later date.

Returns:
true if changes are accumulated, false otherwise.
 o setIsBatched
 public void setIsBatched(boolean batched)
Sets the IsBatched property. ChartData is a model for the ChartGroup object. The IsBatched property controls whether the ChartGroup is notified immediately of ChartData changes, or if the changes are accumulated and sent at a later date.

Parameters:
batched - true if changes are accumulated, false otherwise
 o getFastUpdate
 public boolean getFastUpdate()
Gets the FastUpdate property. This property determines whether column appends are done quickly, only recalculating and redrawing the new data.

Returns:
true if column appends are done quickly
 o setFastUpdate
 public void setFastUpdate(boolean fast)
Sets the FastUpdate property. This property determines whether column appends are done quickly, only recalculating and redrawing the new data.

Parameters:
fast - true if appends are to be done quickly
 o getBufferPlotData
 public boolean getBufferPlotData()
Gets the BufferPlotData property. This property determines whether calculated plot data will be buffered to speed up drawing.

Returns:
true if buffering is to be performed
 o setBufferPlotData
 public void setBufferPlotData(boolean buffer)
Sets the BufferPlotData property. This property determines whether calculated plot data will be buffered to speed up drawing.

Parameters:
buffer - if buffering is to be performed
 o getChartType
 public int getChartType()
Gets the ChartType property of the ChartData object, which determines how the chart data is plotted.

Returns:
enumeration specifying the chart type
 o setChartType
 public void setChartType(int tp)
Sets the ChartType property of the ChartData object, which specifies the type of chart used to plot the data.

Parameters:
tp - enumeration specifying the chart type. Valid values are: JCChart.AREA, JCChart.BAR, JCChart.CANDLE, JCChart.HILO, JCChart.HILO_OPEN_CLOSE, JCChart.PIE, JCChart.PLOT, JCChart.SCATTER_PLOT, and JCChart.STACKING_BAR.
Throws: IllegalArgumentException
If the new chart type is either invalid or not currently supported.
 o getName
 public String getName()
Gets the Name property of the ChartData object. The Name property is used as an index for referencing particular ChartData objects. It can be unparsed JCString text.

Returns:
name of the ChartData object
 o setName
 public void setName(String nm)
Sets the Name property of the ChartData object. The Name property is used as an index for referencing particular ChartData objects. It can be unparsed JCString text.

Parameters:
nm - name of the ChartData object
 o getDrawingOrder
 public int getDrawingOrder()
Gets the DrawingOrder property. The DrawingOrder property determines the drawing order of items. When the DrawingOrder property is changed, the order properties of all ChartDataView instances managed by a single JCChart object are normalized.

Returns:
Integer representing order.
 o setDrawingOrder
 public void setDrawingOrder(int neword)
Sets the DrawingOrder property of the ChartDataView object. The DrawingOrder property determines the drawing order of items. When the DrawingOrder property is changed, the order properties of all ChartDataView instances managed by a single JCChart object are normalized.

Parameters:
neword - new position of the ChartDataView object
 o getDataSource
 public Chartable getDataSource()
Gets the DataSource property for ChartDataView. The DataSource property, if non-null, is used as a source for data in the ChartDataView. The DataSource can refer to an object that implements Chartable or EditableChartable, or it can refer to an object that extends the abstract class ChartDataModel. JCChart will do the "right thing" based on the object provided.

Returns:
object acting as a data source for ChartDataView. This object can either implement Chartable, implement EditableChartable, or be a subclass of ChartDataModel.
 o setDataSource
 public void setDataSource(Chartable src)
Sets the DataSource property for ChartDataView. The DataSource property, if non-null, is used as a source for data in the ChartDataView. The DataSource can refer to an object that implements Chartable or EditableChartable, or it can refer to an object that extends the abstract class ChartDataModel. JCChart will do the correct operation based on the object provided.

Parameters:
src - object acting as a data source for ChartDataView. This object can either implement Chartable, implement EditableChartable, or be a subclass of ChartDataModel.
 o getPointLabel
 public String getPointLabel(int index)
Gets a particular PointLabel from the PointLabels property. The PointLabels property is an indexed property consisting of a series of strings representing the desired label for a particular data point.

Parameters:
index - index of the desired point
Returns:
string representing the requested point label
Throws: IllegalArgumentException
If the point label index does not address a valid point label.
 o setPointLabel
 public void setPointLabel(int index,
                           String label)
Sets a particular PointLabel from the PointLabels property. The PointLabels property is an indexed property consisting of a series of strings representing the desired label for a particular data point.

Parameters:
index - index of the desired point
label - string representing the requested point label
Throws: IllegalArgumentException
If the point label index does not address a valid point label.
 o getPointLabels
 public String[] getPointLabels()
Gets the PointLabels property for the ChartDataView object. The PointLabels property is an indexed property consisting of a series of strings representing the desired label for a particular data point.

Returns:
array of String objects representing the point labels
 o getNumPointLabels
 public int getNumPointLabels()
 o setPointLabels
 public void setPointLabels(String labels[])
Sets the PointLabels property for the ChartDataView object. The PointLabels property is an indexed property consisting of a series of strings representing the desired label for a particular data point.

Parameters:
labels - array of String objects representing the point labels
 o getAutoLabelList
 public JCChartLabel[][] getAutoLabelList()
Gets the AutoLabelList property for the ChartDataView object. The AutoLabelList property is a two-dimensional array of automatically-generated JCChartLabel instances, one for every point and series. The inner array is indexed by point; the outer array by series.

Returns:
array of JCChartLabel objects representing the automatically generated chart labels.
 o getSeries
 public ChartDataViewSeries[] getSeries()
Gets the value of the Series property for this ChartDataView instance. The Series property is an indexed property that contains all data series for a particular ChartDataView. The order of ChartDataViewSeries objects in the series array corresponds to the drawing order.

Returns:
ChartDataViewSeries instance representing the requested data series
 o getSeries
 public ChartDataViewSeries getSeries(int index)
Gets the value of the Series property at a particular index. The Series property is an indexed property that contains all data series for a particular ChartDataView. The order of ChartDataViewSeries objects in the Series array corresponds to the drawing order.

Parameters:
index - index of the data series to retrieve.
Throws: IllegalArgumentException
If the provided index does not address an existing ChartDataViewSeries.
 o setSeries
 public void setSeries(ChartDataViewSeries newseries[])
Sets the value of the Series property for this ChartDataView instance. The Series property is an indexed property that contains all data series for a particular ChartDataView. The order of ChartDataViewSeries objects in the Series array corresponds to the drawing order.

Parameters:
newseries - array of ChartDataViewSeries instances in the desired drawing order. The existing series property will be replaced.
 o setSeries
 public void setSeries(int index,
                       ChartDataViewSeries s)
Sets the value of the Series property at a particular index. The Series property is an indexed property that contains all data series for a particular ChartDataView. The order of ChartDataViewSeries objects in the Series array corresponds to the drawing order.

Parameters:
index - index of the data series to retrieve.
Throws: IllegalArgumentException
If the provided index does not address an existing ChartDataViewSeries.
 o addSeries
 public ChartDataViewSeries addSeries(int index)
Adds a data series to the Series property at the specified index. addSeries() creates a new ChartDataViewSeries instance and adds it to the ChartDataView instance at the requested position if possible.

Parameters:
index - desired position of the new data series
Returns:
new ChartDataViewSeries instance representing the new data series.
 o addSeries
 public void addSeries(ChartDataViewSeries s)
Adds a ChartDataViewSeries to the view at the end of the list.

 o removeSeries
 public void removeSeries(int index)
Removes a single data series from the Series property of the ChartDataView instance. Once the item is removed, the order properties for each ChartDataViewSeries are normalized so that they correspond exactly to their index in the series array.

Parameters:
index - position of the ChartDataViewSeries instance that is to be removed
Throws: IllegalArgumentException
If the index does not address a valid ChartDataViewSeries.
 o getSeriesIndex
 public int getSeriesIndex(String name)
A convenience method to retrieve a data series index given the name of the data series.

Parameters:
name - name of the ChartDataViewSeries instance.
Returns:
index of the data series name; -1 if none found
 o getSeriesIndex
 public int getSeriesIndex(ChartDataViewSeries srs)
A convenience method to retrieve a data series index given data series itself.

Parameters:
srs - the ChartDataViewSeries instance.
Returns:
index of the data series; -1 if none found
 o getPieChartFormat
 public JCPieChartFormat getPieChartFormat()
Gets the value of the PieChartFormat property for the ChartDataView instance. Unless the ChartType property is a pie chart, the PieChartFormat property is null.

Returns:
JCPieChartFormat object that controls pie chart specific formatting information
 o getBarChartFormat
 public JCBarChartFormat getBarChartFormat()
Gets the value of the BarChartFormat property for the ChartDataView instance. Unless the ChartType property is a bar chart, the BarChartFormat property is null.

Returns:
BarChartFormat object that controls bar chart specific formatting information
 o getHiloChartFormat
 public JCHiloChartFormat getHiloChartFormat()
Gets the value of the HiloChartFormat property for the ChartDataView instance. Unless the ChartType property is a hilo chart, the HiloChartFormat property is null.

Returns:
HiloChartFormat object that controls hilo chart specific formatting information
 o getHLOCChartFormat
 public JCHLOCChartFormat getHLOCChartFormat()
Gets the value of the HLOCChartFormat property for the ChartDataView instance. Unless the ChartType property is a HLOC chart, the HLOCChartFormat property is null.

Returns:
HLOCChartFormat object that controls HLOC chart specific formatting information
 o getCandleChartFormat
 public JCCandleChartFormat getCandleChartFormat()
Gets the value of the CandleChartFormat property for the ChartDataView instance. Unless the ChartType property is a candle chart, the CandleChartFormat property is null.

Returns:
CandleChartFormat object that controls HLOC chart specific formatting information
 o getXAxis
 public JCAxis getXAxis()
Gets the value of the XAxis property. The XAxis property determines the x axis against which the data in ChartDataView is plotted.

Returns:
JCAxis object representing the x axis for the data
 o setXAxis
 public void setXAxis(JCAxis ax)
Sets the value of the XAxis property. The XAxis property determines the x axis against which the data in ChartDataView is plotted.

Parameters:
ax - JCAxis object representing the x axis for the data
 o getYAxis
 public JCAxis getYAxis()
Gets the value of the YAxis property. The YAxis property determines the y axis against which the data in ChartDataView is plotted.

Returns:
JCAxis object representing the y axis for the data
 o setYAxis
 public void setYAxis(JCAxis ax)
Sets the value of the YAxis property. The YAxis property determines the y axis against which the data in ChartDataView is plotted.

Parameters:
ax - JCAxis object representing the y axis for the data
 o map
 public JCDataCoord map(int x,
                        int y)
Performs a map operation by mapping the provided screen pixel information to data values along the x and y axes of the ChartDataView instance.

Parameters:
x - x value in screen pixels
y - y value in screen pixels
Returns:
JCDataCoord instance
See Also:
JCDataCoord
 o unmap
 public Point unmap(double xval,
                    double yval)
Performs an unmap operation by taking floating-point x and y values meant to represent a point along the x and y axes of the data.

Parameters:
xval - floating-point x value.
yval - floating-point y value.
Returns:
AWT Point object representing the location in screen pixels (relative to the Chart component)
 o coordToDataCoord
 public JCDataCoord coordToDataCoord(int x,
                                     int y)
Same as map(). Converts pixel coordinates to data coordinates.

Parameters:
x - x value in screen pixels
y - y value in screen pixels
Returns:
JCDataCoord instance
See Also:
JCDataCoord
 o dataCoordToCoord
 public Point dataCoordToCoord(double xval,
                               double yval)
Same as unmap(). Converts data coordinates to pixel coordinates.

Parameters:
xval - floating-point x value.
yval - floating-point y value.
Returns:
AWT Point object representing the location in screen pixels (relative to the Chart component)
 o dataIndexToCoord
 public Point dataIndexToCoord(JCDataIndex di)
Similar to unpick() for a specific data view. Converts a JCDataIndex instance (containing a data view, series, point) to pixel values relative to the Chart component.

Parameters:
di - JCDataIndex instance containing data view, series, and point.
Returns:
AWT Point object representing the location is screen pixels relative to the Chart component.
 o coordToDataIndex
 public JCDataIndex coordToDataIndex(int x,
                                     int y,
                                     int focus)
Similar to pick() for a specific data view. Converts pixel values relative to the Chart component to a JCDataIndex instance containing the data series and point closest to that location.

Parameters:
x - x value of screen position
y - y value of screen position
focus - pick focus value used to determine distance between point and the data drawn by the chart. If equal to ChartDataView.PICK_FOCUS_LOCAL the pickFocus property of the ChartDataView will be used.
di - JCDataIndex instance containing data view, series, and point.
 o getNumSeries
 public int getNumSeries()
Gets the value of the NumSeries parameter, which determines how many data series there are in a ChartDataView. Used in conjunction with getSeries(int index) to retrieve data series

Returns:
number of data series managed by ChartDataView
 o toString
 public String toString()
Output routine used for debugging.

Overrides:
toString in class Object
 o getXLimits
 public MinMax getXLimits()
 o getYLimits
 public MinMax getYLimits()
 o isChanged
 public boolean isChanged()
 o isChanged
 public boolean isChanged(int mask)
 o getChanged
 public boolean getChanged()
 o getChanged
 public boolean getChanged(int mask)
 o setChanged
 public void setChanged(boolean b,
                        int cf)
Sets the value of the Changed property The Changed property manages whether the data view requires recalculation. If set to true, a recalculation may be triggered.

 o setChanged
 public void setChanged(boolean b,
                        int cf,
                        boolean updateParent)
Sets the value of the Changed property, with option to prevent parent updating via the updateParent parameter. Note that updateParent is independent of IsBatched.

 o getFirstLast
 public Point getFirstLast()
Calculates the set of points to be covered by a bar chart by finding the largest FirstPoint value and the smallest LastPoint value. Both values will be tempered by the smallest array of points.

 o getVisibleDataSeries
 public int getVisibleDataSeries()
 o calcTransientData
 public void calcTransientData()
 o setIsInverted
 public void setIsInverted(boolean inv)
Sets the IsInverted property of the data view. If the IsInverted property is set, the x axis becomes vertical, and the y axis becomes horizontal

Parameters:
inv - true if the data is to be inverted, false otherwise.
 o getIsInverted
 public boolean getIsInverted()
Sets the IsInverted property of the data view. If the IsInverted property is set, the x axis becomes vertical, and the y axis becomes horizontal

Returns:
true if the data is to be inverted, false otherwise.
 o setPickFocus
 public void setPickFocus(int foc)
Sets the PickFocus property of the data view, which specifies how distance is determined for pick operations. When set to PICK_FOCUS_XY, a pick operation will use the actual distance between the point and the drawn data. When set to values of PICK_FOCUS_X or PICK_FOCUS_Y, the distance only along the X or Y axis is used.

Parameters:
foc - the value to set the pick focus to.
 o getPickFocus
 public int getPickFocus()
Gets the PickFocus property of the data view. Possible values are PICK_FOCUS_XY, PICK_FOCUS_X, and PICK_FOCUS_Y.

Returns:
the PickFocus property.
 o getIsShowingInLegend
 public boolean getIsShowingInLegend()
Gets the IsShowingInLegend property. This property determines whether or not the view name and it's series will appear in the chart legend.

Returns:
"true" if the name will appear in the legend
 o setIsShowingInLegend
 public void setIsShowingInLegend(boolean shn)
Sets the IsShowingInLegend property. This property determines whether or not the view name and it's series will appear in the chart legend.

 o getAutoLabel
 public boolean getAutoLabel()
Gets the AutoLabel property, which determines if a chart automatically generates labels for each point in each series. The default is false. The labels are stored in the AutoLabelList property. They are created using the Label property of each series.

Returns:
the AutoLabel property.
 o setAutoLabel
 public void setAutoLabel(boolean auto)
Sets the AutoLabel property, which determines if a chart automatically generates labels for each point in each series. The labels are stored in the AutoLabelList property. They are created using the Label property of each series.

Parameters:
auto - the value to set the AutoLabel property to.
 o getOutlineColor
 public Color getOutlineColor()
Gets the value of the OutlineColor property. The OutlineColor property determines the color with which to draw the outline around a filled chart item (e.g. bar, pie);

Returns:
Color instance indicating the color that the outline will be drawn in. If the property has not been set and a parent chart exists, the default color of the chart's forground color will be returned. Otherwise, null is returned.
 o setOutlineColor
 public void setOutlineColor(Color c)
Sets the value of the OutlineColor property. The OutlineColor property determines the color with which to draw the outline around a filled chart item (e.g. bar, pie);

Parameters:
c - the color to draw the outline in.
 o setChartStyle
 public void setChartStyle(int index,
                           JCChartStyle value)
Sets the value of the ChartStyle property. The ChartStyle property contains all the ChartStyles for the data series in this data view.

Parameters:
index - index of the ChartStyle to set
 o getChartStyle
 public JCChartStyle getChartStyle(int index)
Gets the value of the ChartStyle property. The ChartStyle property contains all the ChartStyles for the data series in this data view.

Parameters:
index - index of the ChartStyle to retrieve
Returns:
ChartStyle at the specified index.
 o getChartStyle
 public JCChartStyle[] getChartStyle()
Gets the value of the ChartStyle property. The ChartStyle property contains all the ChartStyles for the data series in this data view.

Returns:
array of JCChartStyle instances used for this data view
 o setChartStyle
 public void setChartStyle(JCChartStyle cs[])
Sets the value of the ChartStyle property. The ChartStyle property contains all the ChartStyles for the data series in this data view.

Parameters:
cs - array of JCChartStyle instances used for this data view
 o setIsShowing
 public void setIsShowing(boolean showing)
Sets whether the dataview is showing or not

 o getIsShowing
 public boolean getIsShowing()
Gets whether the dataview is showing or not

 o outputData
 public void outputData(OutputStream stream)
Save the raw Data to the given output stream The data written should be readable by InputStreamDataSource

Parameters:
stream - the OutputStream to write the data to
 o saveParams
 public void saveParams(String name,
                        JCChart comp)
Save JCChart parameters as HTML tags

Parameters:
name - the PARAM NAME
chart - the JCChart component
 o loadParams
 public void loadParams(String name,
                        JCChart comp)
Load JCChart parameters from HTML file

Parameters:
name - the PARAM NAME
chart - the JCChart component

All Packages  Class Hierarchy  This Package  Previous  Next  Index