AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.annotations.ChartController Improve this Doc

Extends: anychart.core.Base

Chart controller class.

Methods Overview

Specific settings
cancelDrawing()Cancels current annotation drawing.
getSelectedAnnotation()Returns currently selected annotation.
removeAllAnnotations()Removes all annotations from the chart.
removeAnnotation()Removes one of annotations from plot by its instance.
startDrawing()Starts annotation drawing.
Interactivity
select()Selects annotation.
unselect()Unselects annotations.

Methods Description

cancelDrawing

Cancels current annotation drawing.

getSelectedAnnotation

Returns currently selected annotation.

Returns:

anychart.core.annotations.Base - Annotation instance.

removeAllAnnotations

Removes all annotations from the chart.

Returns:

anychart.core.annotations.ChartController - Self instance for method chaining.

removeAnnotation

Removes one of annotations from plot by its instance.

Params:

NameTypeDescription
annotationanychart.core.annotations.BaseAnnotation instance to set.

Returns:

anychart.core.annotations.ChartController - Self instance for method chaining.

select

Selects annotation.

Params:

NameTypeDescription
annotationanychart.core.annotations.BaseAnnotation instance to set.

Returns:

anychart.core.annotations.ChartController - Self instance for method chaining.

startDrawing

Starts annotation drawing.
Note: Works only after anychart.charts.Stock#draw is called.

Params:

NameTypeDescription
annotationTypeOrConfiganychart.enums.AnnotationTypes | string | anychart.core.annotations.AnnotationJSONFormatType or annotation object.

Returns:

anychart.core.annotations.Base - Annotation instance

unselect

Unselects annotations.

Returns:

anychart.core.annotations.ChartController - Self instance for method chaining.