Summ:  Methods    Details:  Methods      Class:  Prev Next
com.artfulbits.aiCharts.Base
Class ChartPointCollection

java.lang.Object com.artfulbits.aiCharts.Base.ChartPointCollection

Declaration: public final class ChartPointCollection extends Object

 

Represents chart points collection used to store chart points. Usually, points collection is exposed via ChartSeries.getPoints(). Be sure to call beginUpdate() and endUpdate() to freeze chart updates when adding/removing lagre amount of points and UI updates are not required. This will dramatically speed up chart performance.

 

Since: 1.0

 

 

Methods Summary
void add(ChartPoint point)
    
Adds the point to points collection.
ChartPoint addDate(java.util.Calendar xDateValue, double y)
    
Adds specified date point to points collection.
ChartPoint addDate(java.util.Date xDateValue, double y)
    
Adds specified date point to points collection.
ChartPoint addDate(long xDateValue, double y)
    
Adds specified date point to points collection.
ChartPoint addXY(double x, double y)
    
Adds specified point to points collection.
void beginUpdate()
    
Tells chart engine to begin updating chart points.
void clear()
    
Clears the points collection.
void endUpdate()
    
Tells chart engine that chart points update has finished and it's time to redraw.
ChartPoint get(int index)
    
Returns ChartPoint at specified index.
int indexOf(ChartPoint point)
    
Gets index of point in the collection.
void remove(ChartPoint point)
    
Removes specified point.
void removeAt(int index)
    
Removes point from specified location.
void setData(byte[] source)
    
Adds points from array of double.
void setData(double[] source)
    
Adds points from array of double.
void setData(java.util.Enumeration data, IItemBinder binder)
    
Adds points from enumeration.
void setData(long[] source)
    
Adds points from array of double.
int size()
    
Gets the size of points collection.

 

Methods inherited from class: java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

 

 

 

size

 

public int size( )

 

Gets the size of points collection.

 

Returns:
size of this collection.

 

Since: 1.0

 

 

 

setData

 

public void setData( double[] source)

 

Adds points from array of double. Fills collection with source values. Each point in resulting collection will have its X value equal to corresponding source index. Therefore, for source = {2,3,6,1,5} following points (1,2) (2,3) (3,6) (4,1) (5,5) will be created.

 

Parameters:
source-
an array of Y values.

 

Since: 1.0

 

 

 

setData

 

public void setData( byte[] source)

 

Adds points from array of double. Fills collection with source values. Each point in resulting collection will have its X value equal to corresponding source index. Therefore, for source = {2,3,6,1,5} following points (1,2) (2,3) (3,6) (4,1) (5,5) will be created.

 

Parameters:
source-

 

Since: 1.0

 

 

 

setData

 

public void setData( long[] source)

 

Adds points from array of double. Fills collection with source values. Each point in resulting collection will have its X value equal to corresponding source index. Therefore, for source = {2,3,6,1,5} following points (1,2) (2,3) (3,6) (4,1) (5,5) will be created.

 

Parameters:
source-
source long array as source of points.

 

Since: 1.0

 

 

 

setData

 

public void setData( java.util.Enumeration data,
IItemBinder binder)

 

Adds points from enumeration.

 

Parameters:
data-
the java.util.Enumeration source.
binder-
binder to bind point to source item. Set null to use default binder.

 

Since: 1.0

 

 

 

beginUpdate

 

public void beginUpdate( )

 

Tells chart engine to begin updating chart points. After this call, no UI updates (layout or paint) will be executed until call to endUpdate(). Enclose your code in beginUpdate() - endUpdate() if you're loading/removing/altering large amount of points.

 

Since: 1.0
See also: endUpdate()

 

 

 

endUpdate

 

public void endUpdate( )

 

Tells chart engine that chart points update has finished and it's time to redraw. Use this call in conjunction with beginUpdate().

 

Since: 1.0

 

 

 

get

 

public ChartPoint get( int index)

 

Returns ChartPoint at specified index.

 

Parameters:
index-
zero-based index of point.
Returns:
instance of ChartPoint class.

 

Since: 1.0

 

 

 

indexOf

 

public int indexOf( ChartPoint point)

 

Gets index of point in the collection.

 

Parameters:
point-
instance of point that is assumed to be present in collection.
Returns:
zero-based index of point.

 

Since: 1.0

 

 

 

add

 

public void add( ChartPoint point)

 

Adds the point to points collection.

 

Parameters:
point-
to add to collection.

 

Since: 1.0

 

 

 

remove

 

public void remove( ChartPoint point)

 

Removes specified point.

 

Parameters:
point-
instance of ChartPoint class that is assumed to be present in this collection.

 

Since: 1.0

 

 

 

removeAt

 

public void removeAt( int index)

 

Removes point from specified location.

 

Parameters:
index-
zero-based index of point that should be removed.

 

Since: 1.0

 

 

 

addXY

 

public ChartPoint addXY( double x,
double y)

 

Adds specified point to points collection.

 

Parameters:
x-
X value of point.
y-
Y values of point.
Returns:
true if the point was successfully added to collection.

 

Since: 1.0

 

 

 

addDate

 

public ChartPoint addDate( java.util.Date xDateValue,
double y)

 

Adds specified date point to points collection. Internally sets ValueType property on series to ChartAxis.TYPE_DATE

 

Parameters:
xDateValue-
date value of point.
y-
corresponding Y value(s).
Returns:
true if the point was successfully added to collection.

 

Since: 1.0

 

 

 

addDate

 

public ChartPoint addDate( long xDateValue,
double y)

 

Adds specified date point to points collection. Internally sets ValueType property on series to ChartAxis.TYPE_DATE

 

Parameters:
xDateValue-
date in milliseconds.
y-
corresponding Y value(s).
Returns:
true if the point was successfully added to collection.

 

Since: 1.0

 

 

 

addDate

 

public ChartPoint addDate( java.util.Calendar xDateValue,
double y)

 

Adds specified date point to points collection. Internally sets ValueType property on series to ChartAxis.TYPE_DATE

 

Parameters:
xDateValue-
date value of point.
y-
corresponding Y value(s).
Returns:
true if the point was successfully added to collection.

 

Since: 1.0

 

 

 

clear

 

public void clear( )

 

Clears the points collection. For each point disconnects any series attached.

 

Since: 1.0

 

 

© 2005 - 2010 ArtfulBits. All rights reserved.