public abstract class

ChartAnnotation

extends Object
java.lang.Object
   ↳ com.artfulbits.aiCharts.Annotations.ChartAnnotation
Known Direct Subclasses

Class Overview

Represents base class for chart annotations. Derived classes are to be added to chart's annotations collection.

Summary

Public Constructors
ChartAnnotation()
Sole constructor.
Public Methods
abstract void draw(Canvas canvas, ChartEngine chart)
Draws annotation of specified canvas.
String getDescription()
Gets custom description of annotation.
int getOffset()
Gets value used to offset annotation from position specified by setPosition(ChartAnnotationPosition)
ChartAnnotationPosition getPosition()
Gets instance of ChartAnnotationPosition class used to determine annotation's location on chart.
void setDescription(String description)
Sets custom description of annotation.
void setOffset(int offset)
Sets the annotation's offset from position specified by getPosition().
void setPosition(ChartAnnotationPosition position)
Sets position that determines annotation's location on chart.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ChartAnnotation ()

Sole constructor. (For invocation by subclass constructors, typically implicit.)

Public Methods

public abstract void draw (Canvas canvas, ChartEngine chart)

Draws annotation of specified canvas.

Parameters
canvas instance of canvas that is used to draw annotation.
chart instance of parent chart.

public String getDescription ()

Gets custom description of annotation. This value is used to draw annotation's description if the one is displayed on legend.

Returns
  • value of annotation's description.

public int getOffset ()

Gets value used to offset annotation from position specified by setPosition(ChartAnnotationPosition)

Returns
  • offset value.

public ChartAnnotationPosition getPosition ()

Gets instance of ChartAnnotationPosition class used to determine annotation's location on chart.

Returns

public void setDescription (String description)

Sets custom description of annotation. This value is used to draw annotation's description if the one is displayed on legend.

Parameters
description custom annotation's description.

public void setOffset (int offset)

Sets the annotation's offset from position specified by getPosition().

Parameters
offset value of annotation's offset.

public void setPosition (ChartAnnotationPosition position)

Sets position that determines annotation's location on chart. See members of ChartAnnotationPosition class for ready solutions of create a new one.

Parameters
position instance of ChartAnnotationPosition class that is used to determine annotation's location on.