com.steema.teechart.styles
Class FastLine

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.styles.Series
          extended by com.steema.teechart.styles.FastLine
All Implemented Interfaces:
ISeries

public class FastLine
extends Series

Title: FastLine class

Description: The FastLine Series is an extremely simple Series component that draws its points as fast as possible.

Example:


 myChart.getAxes().setVisible(true);
 myChart.setClipPoints(true);

 // hide things for better speed
 myChart.getAspect().setView3D(false);
 myChart.getLegend().setVisible(false);
 myChart.getFooter().setVisible(false);
 myChart.getHeader().setVisible(false);
 

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL


Nested Class Summary
 
Nested classes/interfaces inherited from class com.steema.teechart.styles.Series
Series.MarkTextResolver
 
Field Summary
protected  ChartPen linePen
           
protected  boolean treatNans
           
protected  TreatNullsStyle treatnulls
           
 
Fields inherited from class com.steema.teechart.styles.Series
AUTODEPTH, AUTOZORDER, bActive, bBrush, bColorEach, calcVisiblePoints, colorMember, customMarkText, drawBetweenPoints, endZ, firstVisible, hasZValues, iColors, iNumSampleValues, iZOrder, labelMember, lastVisible, listenerList, mandatory, manualData, marks, middleZ, notMandatory, percentDecimal, percentFormat, sLabels, startZ, useAxis, useSeriesColor, valueFormat, vxValues, vyValues, yMandatory
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
FastLine()
           
FastLine(IBaseChart c)
           
 
Method Summary
 void add(double[] xValues, double[] yValues, boolean append)
           
 int add(double x, double y)
          Adds a new point with specified x and y values.
 void assign(Series source)
          Copies all properties from one Series component to another.
protected  double calcMinMaxValue(boolean isMin)
           
 int clicked(int x, int y)
          Returns the ValueIndex of the "clicked" point in the Series.
 void createSubGallery(Gallery addSubChart)
           
protected  boolean doNotPaintNull()
           
protected  void draw()
           
protected  void drawLegendShape(IGraphics3D g, int valueIndex, Rectangle rect)
           
protected  void drawMark(int valueIndex, java.lang.String st, SeriesMarksPosition aPosition)
           
 void drawValue(int index)
          Called internally.
 boolean getAutoRepaint()
          Repaints Chart after any changes are made.
 java.lang.String getDescription()
          Gets descriptive text.
 boolean getDrawAllPoints()
          When false, it only draws the first point at any X pixel location.
 DrawAllPointsStyle getDrawAllPointsStyle()
          The DrawAllPoints style.
 boolean getIgnoreNulls()
          Displays null points when false
For speed reasons, FastLine series supports null (empty) values only when IgnoreNulls is false.
 boolean getInvertedStairs()
          Controls the FastLine series drawing.
 ChartPen getLinePen()
          Determines pen to draw the line connecting all points.
 double getMaxYValue()
          The Maximum Value of the Series Y Values List.
 double getMinYValue()
          The Minimum Value of the Series Y Values List.
 boolean getStairs()
          Controls the drawing of FastLine series.
 int getTransparency()
          The Transparency of the FastLine series as a percentage.
 boolean getTreatNaNAsNull()
           
 TreatNullsStyle getTreatNulls()
          Defines how null points are treated.
protected  boolean IgnoreNull()
           
 void setAutoRepaint(boolean value)
          Repaints Chart after any changes are made.
 void setChart(IBaseChart value)
          Chart associated with this object.
 void setColor(Color value)
          Default color for all points.
 void setDrawAllPoints(boolean value)
          When false, it only draws the first point at any X pixel location.
 void setDrawAllPointsStyle(DrawAllPointsStyle value)
          Sets the DrawAllPoints style.
 void setIgnoreNulls(boolean value)
          Displays null points when false
Default value: true
Example: lineSeries1.setNull( 123 ); // -- make null (empty) point index 123 lineSeries1.setIgnoreNulls( false ); // -- allow null points lineSeries1.setStairs( true ); // -- set "stairs" mode
 void setInvertedStairs(boolean value)
          Controls the FastLine series drawing.
 void setStairs(boolean value)
          Controls the drawing of FastLine series.
 void setSubGallery(int index)
          Creates and prepares the index'th Series style to show at sub-gallery dialog.
 void setTransparency(int value)
          Sets the Transparency of the FastLine series as a percentage.
 void setTreatNaNAsNull(boolean value)
           
 void setTreatNulls(TreatNullsStyle value)
           
 
Methods inherited from class com.steema.teechart.styles.Series
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addChartValue, added, addedValue, addNull, addNullXY, addSampleValues, addSeriesMouseListener, addSeriesPaintListener, addValues, assignDispose, assignValues, associatedToAxis, beginUpdate, calcFirstLastVisibleIndex, calcHorizMargins, calcPercentSt, calcPosValue, calculateMarkPosition, calcVerticalMargins, calcXPos, calcXPosValue, calcXSizeValue, calcYPos, calcYPosValue, calcYSizeValue, calcZOrder, canAddRandomPoints, changeType, checkDataSource, checkMouse, checkOrder, checkOtherSeries, clear, clearLists, clicked, clone, cloneSeries, convertArray, countLegendItems, createNewSeries, createNewSeries, createNewSeries, dataSourceArray, delete, delete, delete, dispose, doAfterDrawValues, doBeforeDrawChart, doBeforeDrawValues, doClick, doClickPointer, doDoubleClick, drawHiddenValue, drawLegend, drawLegend, drawMarks, drawMarksSeries, drawSeries, drawSeriesForward, drawValuesForward, endUpdate, fillSampleValues, fillSampleValues, fireSeriesMouseEvent, fireSeriesPaint, firstDisplayed, galleryChanged3D, getActive, getAllowSinglePoint, getBrush, getColor, getColorEach, getColorMember, getColors, getCount, getCountLegendItems, getCursor, getCustomHorizAxis, getCustomVertAxis, getDataSource, getDefaultColor, getDefaultNullValue, getDepth, getEndZ, getFields, getFirstVisible, getFunction, getHasZValues, getHorizAxis, getHorizontalAxis, getLabelMember, getLabels, getLastVisible, getLegendString, getMandatory, getMandatoryAxis, getMarks, getMarkText, getMarkValue, getMaxXValue, getMaxZValue, getMiddleZ, getMinXValue, getMinZValue, getNotMandatory, getNumGallerySeries, getNumSampleValues, getOriginValue, getPercentFormat, getPoint, getSeriesColor, getShowInLegend, getStartZ, getTitle, getUseAxis, getValueColor, getValueFormat, getValueIndexSwapper, getValueList, getValueList, getValueMarkText, getValuesLists, getVertAxis, getVerticalAxis, getVisible, getXValues, getYMandatory, getYValueList, getYValues, getZOrder, hasClickEvents, hasDataSource, hasListenersOf, hasNoMandatoryValues, isNull, isPointInChartRect, isValidSeriesSource, isValidSourceOf, lastDisplayed, lastVisibleMark, legendItemColor, legendToValueIndex, maxMarkWidth, moreSameZOrder, mouseEvent, newFromType, numSampleValues, onDisposing, prepareForGallery, prepareLegendCanvas, randomBounds, readResolve, recalcGetAxis, refreshSeries, removeMarkTextResolver, removeSeriesMouseListener, removeSeriesPaintListener, repaint, sameClass, setActive, setColorEach, setColorMember, setColors, setCursor, setCustomHorizAxis, setCustomHorizAxis, setCustomVertAxis, setCustomVertAxis, setDataSource, setDefaultNullValue, setDepth, setEndZ, setFunction, setHorizontal, setHorizontalAxis, setLabelMember, setLabels, setMarks, setMarkTextResolver, setMiddleZ, setNull, setNull, setPercentFormat, setSeriesColor, setShowInLegend, setStartZ, setTitle, setValueFormat, setValueList, setVerticalAxis, setVisible, setXValues, setYValues, setZOrder, setZPositions, sortByLabels, sortByLabels, swapValueIndex, titleOrName, toString, valueListOfAxis, valuesListAdd, xScreenToValue, yScreenToValue
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.steema.teechart.styles.ISeries
getChart, invalidate
 

Field Detail

linePen

protected ChartPen linePen

treatnulls

protected TreatNullsStyle treatnulls

treatNans

protected boolean treatNans
Constructor Detail

FastLine

public FastLine(IBaseChart c)

FastLine

public FastLine()
Method Detail

setChart

public void setChart(IBaseChart value)
Description copied from class: TeeBase
Chart associated with this object.

Specified by:
setChart in interface ISeries
Parameters:
value - IBaseChart

getMaxYValue

public double getMaxYValue()
Description copied from class: Series
The Maximum Value of the Series Y Values List.

Overrides:
getMaxYValue in class Series
Returns:
double

getMinYValue

public double getMinYValue()
Description copied from class: Series
The Minimum Value of the Series Y Values List.

Overrides:
getMinYValue in class Series
Returns:
double

getAutoRepaint

public boolean getAutoRepaint()
Repaints Chart after any changes are made.
Use AutoRepaint false to disable Chart repainting whilst, for example, adding a large number of points to a FastLine Series. This avoids repainting of the Chart whilst the points are added.
AutoRepaint may be re-enabled, followed by a manual Repaint command when all points are added.
Default value: true

Returns:
boolean

setAutoRepaint

public void setAutoRepaint(boolean value)
Repaints Chart after any changes are made.
Default value: true

Parameters:
value - boolean

getTransparency

public int getTransparency()
The Transparency of the FastLine series as a percentage. Default value: 0

Returns:
int

setTransparency

public void setTransparency(int value)
Sets the Transparency of the FastLine series as a percentage. Default value: 0

Parameters:
value - int

getDrawAllPoints

public boolean getDrawAllPoints()
When false, it only draws the first point at any X pixel location. The option offers speed gains if large numbers of point repetitions occur at one X location.
Default value: true

Returns:
boolean

setDrawAllPoints

public void setDrawAllPoints(boolean value)
When false, it only draws the first point at any X pixel location. The option offers speed gains if large numbers of point repetitions occur at one X location.
Default value: true

Example:


 lineSeries.setDrawAllPoints( false );
 

Parameters:
value - boolean

getDrawAllPointsStyle

public DrawAllPointsStyle getDrawAllPointsStyle()
The DrawAllPoints style.
It defines the method used to calculate the DrawAllPoints style.
FastLine series DrawAllPoints should be false.
Default value: FIRST

Returns:
DrawAllPointsStyle

setDrawAllPointsStyle

public void setDrawAllPointsStyle(DrawAllPointsStyle value)
Sets the DrawAllPoints style.
Default value: FIRST

Parameters:
value - DrawAllPointsStyle

setColor

public void setColor(Color value)
Description copied from class: Series
Default color for all points.
Default value: Color.Empty

Overrides:
setColor in class Series
Parameters:
value - Color
See Also:
Series.getColorEach()

clicked

public int clicked(int x,
                   int y)
Returns the ValueIndex of the "clicked" point in the Series.
Clicked means the X and Y coordinates are in the point screen region bounds. If no point is "touched", Clicked returns -1

Specified by:
clicked in interface ISeries
Overrides:
clicked in class Series
Parameters:
x - int
y - int
Returns:
int

draw

protected void draw()
Overrides:
draw in class Series

drawValue

public void drawValue(int index)
Called internally. Draws the "ValueIndex" point of the Series.

Specified by:
drawValue in interface ISeries
Overrides:
drawValue in class Series
Parameters:
index - int

drawMark

protected void drawMark(int valueIndex,
                        java.lang.String st,
                        SeriesMarksPosition aPosition)
Overrides:
drawMark in class Series

drawLegendShape

protected void drawLegendShape(IGraphics3D g,
                               int valueIndex,
                               Rectangle rect)
Overrides:
drawLegendShape in class Series

createSubGallery

public void createSubGallery(Gallery addSubChart)
Overrides:
createSubGallery in class Series

setSubGallery

public void setSubGallery(int index)
Description copied from class: Series
Creates and prepares the index'th Series style to show at sub-gallery dialog.

Specified by:
setSubGallery in interface ISeries
Overrides:
setSubGallery in class Series
Parameters:
index - int

getStairs

public boolean getStairs()
Controls the drawing of FastLine series.
In most normal situations, a series draws a line between each Line point. This makes the Line appear as a "mountain" shape.
However, setting Stairs to true will make the Series to draw 2 Lines between each pair of points, thus giving a "stairs" appearance.
This is most used in some financial Chart representations.
When Stairs is set to true you may set InvertedStairs to true to alter the direction of the step.
Default value: false

Returns:
boolean

setStairs

public void setStairs(boolean value)
Controls the drawing of FastLine series.
Default value: false

Example:


 lineSeries1.setStairs( true );
 

Parameters:
value - boolean

getInvertedStairs

public boolean getInvertedStairs()
Controls the FastLine series drawing.
When Stairs is set to true you may set InvertedStairs to true to alter the direction of the step.
In most normal situations, the Series draws a line between each Line point. This makes the Line appear as a "mountain" shape.
However, setting Stairs to true will make the Series draw 2 Lines between each pair of points, thus giving a "stairs" appearance.
This is most used in some financial Chart representations. You may invert the stair by setting InvertedStairs to true.
Default value: false

Returns:
boolean

setInvertedStairs

public void setInvertedStairs(boolean value)
Controls the FastLine series drawing.
Default value: false

Parameters:
value - boolean

getIgnoreNulls

public boolean getIgnoreNulls()
Displays null points when false
For speed reasons, FastLine series supports null (empty) values only when IgnoreNulls is false.
By default all points are displayed (IgnoreNulls is true by default).
To enable FastLine series to hide null points, set IgnoreNulls to false.
Default value: true

Returns:
boolean

setIgnoreNulls

public void setIgnoreNulls(boolean value)
Displays null points when false
Default value: true

Example:


 lineSeries1.setNull( 123 ); // -- make null (empty) point index 123
 lineSeries1.setIgnoreNulls( false ); // -- allow null points
 lineSeries1.setStairs( true ); // -- set "stairs" mode
 

Parameters:
value - boolean

doNotPaintNull

protected boolean doNotPaintNull()

getDescription

public java.lang.String getDescription()
Gets descriptive text.

Overrides:
getDescription in class Series
Returns:
String

assign

public void assign(Series source)
Description copied from class: Series
Copies all properties from one Series component to another.
Only the common properties shared by both source and destination Series are copied.
The following code copies all properties from Series2 into Series1:

Series1.Assign( Series2 ) ;

Some Series types restore method values after assigning them. For example, Points series restores the Pointer.Visible method to true after being assigned to a Line series, which has Pointers invisible by default.
Note: Series events are not assigned. Series DataSource and FunctionType properties are assigned. Assign is used by CloneChartSeries and ChangeSeriesType methods for example.

Overrides:
assign in class Series
Parameters:
source - Series

calcMinMaxValue

protected double calcMinMaxValue(boolean isMin)

getLinePen

public ChartPen getLinePen()
Determines pen to draw the line connecting all points.

Returns:
ChartPen

getTreatNulls

public TreatNullsStyle getTreatNulls()
Defines how null points are treated.

Returns:
TreatNullsStyle

setTreatNulls

public void setTreatNulls(TreatNullsStyle value)

add

public void add(double[] xValues,
                double[] yValues,
                boolean append)
Overrides:
add in class Series

add

public int add(double x,
               double y)
Description copied from class: Series
Adds a new point with specified x and y values.

Specified by:
add in interface ISeries
Overrides:
add in class Series
Parameters:
x - double
y - double
Returns:
int

IgnoreNull

protected boolean IgnoreNull()

getTreatNaNAsNull

public boolean getTreatNaNAsNull()

setTreatNaNAsNull

public void setTreatNaNAsNull(boolean value)