com.steema.teechart.styles
Class SeriesMarks

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.Shape
          extended by com.steema.teechart.TextShape
              extended by com.steema.teechart.styles.SeriesMarks

public class SeriesMarks
extends TextShape

Title: SeriesMarks

Description: Series Marks characteristics.

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

Company: Steema Software SL


Field Summary
protected  boolean bClip
           
 boolean checkMarkArrowColor
          When True, Marks arrow pen color is changed if the point has the same color.
protected  ISeries iSeries
           
protected  MarksStyle markerStyle
           
protected  MarkPositions pPositions
           
 
Fields inherited from class com.steema.teechart.TextShape
defaultText, drawText
 
Fields inherited from class com.steema.teechart.Shape
bBevel, bBorderRound, bBrush, bImageBevel, bTransparent, defaultVisible, pPen, shadow, shapeBounds, visible
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
SeriesMarks(ISeries s)
           
 
Method Summary
 boolean allSeriesVisible()
           
protected  void antiOverlap(int first, int valueIndex, SeriesMarksPosition aPos)
           
protected  SeriesMarksPosition applyArrowLength(SeriesMarksPosition aPos)
           
 void clear()
          Removes all mark positions and mark items.
 int clicked(int x, int y)
          Determines which Mark contains the XY pixel point parameters.
 int clicked(Point p)
          Determines which Mark contains the p point parameters.
protected  Point convertTo2D(SeriesMarksPosition aPos, Point p)
           
 double getAngle()
          The angle from 0 to 360 to rotate Marks.
 ChartPen getArrow()
          The Pen used to draw a line connecting Marks to Series points.
 int getArrowLength()
          The length in pixels for the line connecting the Mark to Series point.
 Color getBackColor()
          Obsolete.
 MarksCallout getCallout()
          Marks Callout characteristics.
 boolean getClip()
          Restricts Marks to Chart axes space, when true.
 int getDrawEvery()
          The number of Marks to skip.
 ChartPen getFrame()
          Obsolete.
 MarksItems getItems()
          Returns a collection of mark items.
 java.lang.String[] getLines()
          Contains the list of lines drawn on the chart by the user at run-time.
 boolean getMultiLine()
          Characters in Mark texts are split into multiple lines, when true.
 boolean getOnTop()
          Series Marks are always drawn on top of all other Series in the Chart, when true.
 MarkPositions getPositions()
          Accesses Custom position characteristics for Series Marks.
 ISeries getSeries()
          Series is a read-only runtime method.
 MarksStyle getStyle()
          Defines how Series Marks are static finalructed.
 SeriesMarksSymbols getSymbol()
           
 int getZPosition()
          The Position in pixels on the Z axis.
protected  void internalDraw(int index, Color aColor, java.lang.String st, SeriesMarksPosition aPos)
           
protected  TextShape markItem(int valueIndex)
           
 java.lang.String percentString(int valueIndex, boolean addTotal)
          Returns the String showing a "percent" value for a given point.
protected  java.lang.Object readResolve()
           
 void resetPositions()
          Tells chart to repaint using automatically positioned marks.
 void setAngle(double value)
          Sets angle from 0 to 360 to rotate Marks.
 void setArrowLength(int value)
          Stes the length in pixels of the line connecting the Mark to Series point.
 void setBackColor(Color value)
          Obsolete.
 void setChart(IBaseChart value)
          Chart associated with this object.
 void setClip(boolean value)
          Restricts Marks to Chart axes space, when true.
 void setDrawEvery(int value)
          Sets the number of Marks to skip.
 void setItems(MarksItems value)
           
 void setMultiLine(boolean value)
          Characters in Mark texts are split into multiple lines, when true.
 void setOnTop(boolean value)
          Series Marks are always drawn on top of all other Series in the Chart, when true.
 void setStyle(MarksStyle value)
          Defines how Series Marks are constructed.
 void setZPosition(int value)
          Sets Position in pixels on the Z axis.
 int textWidth(int valueIndex)
          Returns the length in pixels for the ValueIndex th mark text String.
 
Methods inherited from class com.steema.teechart.TextShape
assign, drawRectRotated, drawString, drawText, getAutoSize, getFont, getLinesLength, getShadowSize, getShapeStyle, getText, getTextFormat, paint, paint, paint, setAutoSize, setDrawText, setLines, setShadowSize, setShapeStyle, setText, setTextFormat
 
Methods inherited from class com.steema.teechart.Shape
assign, getBevel, getBevelInner, getBevelOuter, getBevelWidth, getBorderRound, getBottom, getBrush, getColor, getGradient, getHeight, getImage, getImageBevel, getImageMode, getImageTransparent, getLeft, getPen, getRight, getShadow, getShapeBounds, getTop, getTransparency, getTransparent, getVisible, getWidth, setBevel, setBevelInner, setBevelOuter, setBevelWidth, setBorderRound, setBottom, setBrush, setColor, setDefaultVisible, setHeight, setImage, setImageMode, setImageTransparent, setLeft, setPen, setRight, setShapeBounds, setTop, setTransparency, setTransparent, setVisible, setWidth
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkMarkArrowColor

public boolean checkMarkArrowColor
When True, Marks arrow pen color is changed if the point has the same color.


iSeries

protected transient ISeries iSeries

pPositions

protected transient MarkPositions pPositions

bClip

protected boolean bClip

markerStyle

protected MarksStyle markerStyle
Constructor Detail

SeriesMarks

public SeriesMarks(ISeries s)
Method Detail

readResolve

protected java.lang.Object readResolve()
Overrides:
readResolve in class TextShape

getCallout

public MarksCallout getCallout()
Marks Callout characteristics.
Determines how to draw a line connecting a series mark to its series point.

Returns:
MarksCallout

getItems

public MarksItems getItems()
Returns a collection of mark items.
Each mark item has its own formatting (color, font, shadow, etc).
By default Items are empty, so the default marks formatting is used.

Returns:
MarksItems

setItems

public void setItems(MarksItems value)

getPositions

public MarkPositions getPositions()
Accesses Custom position characteristics for Series Marks.
TeeChart for Net has a number of algorithmns that were designed to stop TeeChart SeriesMark overlap. However, if you aren't happy with the automatically generated mark positions, you can always move marks around with code.

(Remember that you could also use the DragMarks Tool to reposition marks on your Chart.)

Returns:
MarkPositions

getLines

public java.lang.String[] getLines()
Contains the list of lines drawn on the chart by the user at run-time.

Overrides:
getLines in class TextShape
Returns:
String[]

getSeries

public ISeries getSeries()
Series is a read-only runtime method.
It returns the Series component that owns the TSeriesMarks subcomponent.
All Series types own a Marks subcomponent of the TSeriesMarks class.

Returns:
ISeries

getStyle

public MarksStyle getStyle()
Defines how Series Marks are static finalructed.
Each different Style value makes Marks output a different text. Several options are available, but you can also use the TChart Series.OnGetMarkText event and override the default Series Marks text.
Default value: MarksStyle.Label

Returns:
MarksStyle

setStyle

public void setStyle(MarksStyle value)
Defines how Series Marks are constructed.
Default value: MarksStyle.Label

Parameters:
value - MarksStyle

getSymbol

public SeriesMarksSymbols getSymbol()

setChart

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

Overrides:
setChart in class TextShape
Parameters:
value - IBaseChart

resetPositions

public void resetPositions()
Tells chart to repaint using automatically positioned marks.
Turns all Marks positions Custom to false.


clear

public void clear()
Removes all mark positions and mark items.


clicked

public int clicked(Point p)
Determines which Mark contains the p point parameters.

Parameters:
p - Point
Returns:
int

clicked

public int clicked(int x,
                   int y)
Determines which Mark contains the XY pixel point parameters.

Parameters:
x - int
y - int
Returns:
int the Mark index containing the XY point.

getBackColor

public Color getBackColor()
Obsolete. Use the Color method instead.

Returns:
Color

setBackColor

public void setBackColor(Color value)
Obsolete. Use the Color method instead.

Parameters:
value - Color

getFrame

public ChartPen getFrame()
Obsolete. Use the Pen method instead.

Returns:
ChartPen

getArrow

public ChartPen getArrow()
The Pen used to draw a line connecting Marks to Series points.
Each Series class handles Marks in a different manner, thus the Arrow coordinates are specific to each Series type.
By default, Arrow pen is defined to be a White solid pen of 1 pixel width.

Returns:
ChartPen

getArrowLength

public int getArrowLength()
The length in pixels for the line connecting the Mark to Series point.
Default value: 16

Returns:
int

setArrowLength

public void setArrowLength(int value)
Stes the length in pixels of the line connecting the Mark to Series point.
Default value: 16

Parameters:
value - int

getClip

public boolean getClip()
Restricts Marks to Chart axes space, when true.
When true, Marks will be drawn only within inner chart boundaries, keeping Axis Labels, Titles, Legend, etc almost untouched.
Default value: false

Returns:
boolean

setClip

public void setClip(boolean value)
Restricts Marks to Chart axes space, when true.
Default value: false

Parameters:
value - boolean

getOnTop

public boolean getOnTop()
Series Marks are always drawn on top of all other Series in the Chart, when true.
Default value: false

Returns:
boolean

setOnTop

public void setOnTop(boolean value)
Series Marks are always drawn on top of all other Series in the Chart, when true.
Default value: false


getMultiLine

public boolean getMultiLine()
Characters in Mark texts are split into multiple lines, when true.
Default value: false

Returns:
boolean

setMultiLine

public void setMultiLine(boolean value)
Characters in Mark texts are split into multiple lines, when true.
Default value: false

Parameters:
value - boolean

getDrawEvery

public int getDrawEvery()
The number of Marks to skip.
Default is 1, all Marks are displayed. Setting it to two will draw every other Mark, to three every third etc.
Default value: 1

Returns:
int

setDrawEvery

public void setDrawEvery(int value)
Sets the number of Marks to skip.
Default value: 1

Parameters:
value - int

getAngle

public double getAngle()
The angle from 0 to 360 to rotate Marks.
Default value: 0

Returns:
double

setAngle

public void setAngle(double value)
Sets angle from 0 to 360 to rotate Marks.
Default value: 0

Parameters:
value - double

getZPosition

public int getZPosition()
The Position in pixels on the Z axis.

Returns:
int

setZPosition

public void setZPosition(int value)
Sets Position in pixels on the Z axis.

Parameters:
value - int

allSeriesVisible

public boolean allSeriesVisible()

applyArrowLength

protected SeriesMarksPosition applyArrowLength(SeriesMarksPosition aPos)

percentString

public java.lang.String percentString(int valueIndex,
                                      boolean addTotal)
Returns the String showing a "percent" value for a given point.
For example: "25%"
The optional "AddTotal" parameter, when true, returns: "25% of 1234".

Parameters:
valueIndex - int
addTotal - boolean
Returns:
String

textWidth

public int textWidth(int valueIndex)
Returns the length in pixels for the ValueIndex th mark text String.
It checks if the Mark has multiple lines of text.

Parameters:
valueIndex - int
Returns:
int

convertTo2D

protected Point convertTo2D(SeriesMarksPosition aPos,
                            Point p)

antiOverlap

protected void antiOverlap(int first,
                           int valueIndex,
                           SeriesMarksPosition aPos)

markItem

protected TextShape markItem(int valueIndex)

internalDraw

protected void internalDraw(int index,
                            Color aColor,
                            java.lang.String st,
                            SeriesMarksPosition aPos)