Annotations

getAnnotation()

This method creates an annotation. In addition to this method, the following methods can be used to define, show, and format the annotation:

setDisplay(getAnnotation(index), true);

setTextString(getAnnotation(index), "string");

setFillColor(getAnnotation(index),new Color(0,255,0));

Note that all other fill types are also available for annotation labels (i.e., gradient, texture, etc.).

setFontSizeAbsolute(getAnnotation(0),true);
setFontSizeInPoints(getAnnotation(0),20);

setRect(getAnnotation(0),new Rectangle(-15340,11000,29850,1800));

NOTE: If you do not specify a location, the annotation text will draw in the default location (center of the chart) and will not be detectable! This is due to the fact that a rectangle is not internally stored for the annotation. Unless specified otherwise, it will use the the default rectangle set by setRect(). It is recommended you store a rectangle location for each annotation.

SYNTAX:

IdentObj getAnnotation(int index)

INPUT:

index; zero (0) to the maximum number of annotations set by setMaxNumAnnotations(int nMax). The default maximum number of annotations is 30.

EXAMPLE:

setDepthRadius(0);
setGraphType(41);
setDisplay(getAnnotation(0),true);
setTextString(getAnnotation(0),"This is a movable annotation");
setFillColor(getAnnotation(0),new Color(0,255,0));
setRect(getAnnotation(0),new Rectangle(-15340,11000,29850,1800));
setFontSizeAbsolute(getAnnotation(0),true);
setFontSizeInPoints(getAnnotation(0),20.0);

NOTES:

The title, subtitle and footnote objects have the same behavior as annotations. See: getFootnote(), getFootnoteBox(), getSubtitle(), getSubtitleBox(), getTitle(), and getTitleBox()

ALSO SEE:

getAnnotationBox(), getAnnotationsDisplay() get/setMaxNumAnnotations()

getAnnotationBox()

This method creates a bounding box around an annotation. The following methods can be used to enable/show and format the annotation box:

setDisplay(getAnnotationBox(index),true);

setFillColor(getAnnotationBox(0),new Color(0,0,255));

setTransparentBorderColor(getAnnotationBox(0),false);
setTransparentFillColor(getAnnotationBox(0),true);

See get/setBorderType() for information about applying a border to an annotation box.

SYNTAX:

IdentObj getAnnotationBox(int index)

INPUT:

index; zero (0) to the maximum number of annotations set by setMaxNumAnnotations(int nMax). The default maximum number of annotations is 30.

EXAMPLE:

setDisplay(getAnnotation(0),true);
setTextString(getAnnotation(0),"This is a movable annotation");
setFillColor(getAnnotation(0),new Color(0,255,0));
setRect(getAnnotation(0),new Rectangle(-15340,11000,29850,1800));
setFontSizeAbsolute(getAnnotation(0),true);
setFontSizeInPoints(getAnnotation(0),16.0);
setDisplay(getAnnotationBox(0),true);
setFillColor(getAnnotationBox(0),new Color(0,0,255));
setTransparentBorderColor(getAnnotationBox(0),false);

NOTES:

The default maximum number of annotations is 30. For this first default set of annotations, the transparent fill color is set to true and border colors are omitted for the associated annotation box:

setTransparentFillColor(getAnnotationBox(nnn),true);
setTransparentBorderColor(getAnnotationBox(nnn),true);

ALSO SEE:

getAnnotation(), getAnnotationsDisplay() get/setMaxNumAnnotations()

getAnnotationsDisplay()

This method can be used to determine if annotation objects have been created and drawn in the chart.

SYNTAX:

boolean getAnnotationsDisplay()

INPUT:

none

RETURN:

boolean; true = one or more annotations objects have been created, false = no annotation objects in chart.

ALSO SEE:

getAnnotation(), getAnnotationBox(), get/setMaxNumAnnotations()

get/setMaxNumAnnotations()

These methods get/set the maximum number of annotations. The default value is 30.

SYNTAX:

int getMaxNumAnnotations();
void setMaxNumAnnotations(int newValue);

INPUT:

newValue; For setMaxNumAnnotations(), the maximum number (0...999) of annotations that can be created with getAnnotation().

RETURN:

int; For getMaxNumAnnotations(), the maximum number (0...999) of annotations that can be created with getAnnotation().

NOTES:

For annotations in excess of the default (30), the setTransparentFillColor() and setTransparentBorderColor() methods should be used to set transparent fill and border colors for the associated annotation box as desired:

setTransparentFillColor(getAnnotationBox(nnn),true | false);
setTransparentBorderColor(getAnnotationBox(nnn),true | false);

ALSO SEE:

getAnnotation(), getAnnotationBox(), getAnnotationsDisplay()