AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.annotations.PlotController Improve this Doc

Extends: anychart.core.VisualBase

Plot controller class.

Methods Overview

Specific settings
add()Adds annotation on the plot.
andrewsPitchfork()Creates and returns an Andrews Pitchfork annotation.
cancelDrawing()Cancels annotation drawing.
ellipse()Creates and returns an Ellipse annotation.
enabled()Disable or enable plot controller.
fibonacciArc()Creates and returns a Fibonacci Arc annotation.
fibonacciFan()Creates and returns a Fibonacci Fan annotation.
fibonacciRetracement()Creates and returns a Fibonacci Retracement annotation.
fibonacciTimezones()Creates and returns a Fibonacci Timezones annotation.
finiteTrendChannel()Creates and returns a Finite Trend Channel annotation.
getAnnotationAt()Returns annotation by index.
getAnnotationsCount()Returns annotations count.
getSelectedAnnotation()Returns selected annotation.
horizontalLine()Creates and returns a Horizontal Line annotation.
horizontalRange()Creates and returns a Horizontal Range annotation.
infiniteLine()Creates and returns an Infinite Line annotation.
label()Creates and returns a Label annotation.
line()Creates and returns a Line annotation.
marker()Creates and returns a Marker annotation.
ray()Creates and returns a Ray annotation.
rectangle()Creates and returns a Rectangle annotation.
removeAllAnnotations()Removes all annotations from a plot.
removeAnnotation()Removes an annotation from a plot by its instance.
removeAnnotationAt()Removes an annotation from a plot by its index.
startDrawing()Starts annotation drawing.
trendChannel()Creates and returns a Trend Channel annotation.
triangle()Creates and returns a Triangle annotation.
verticalLine()Creates and returns a Vertical Line annotation.
verticalRange()Creates and returns a Vertical Range annotation.
Interactivity
select()Selects annotation.
unselect()Unselects annotations.
Size and Position
zIndex()Z-index of the element.
XML/JSON
fromJson()Creates annotations list by JSON config.
fromXml()Creates annotations list by XML config.
toJson()Return plot annotations configuration as JSON object or string.
toXml()Return plot annotations configuration as XML string or XMLNode.

Methods Description

add

Adds annotation on the plot.

Params:

NameTypeDescription
annotationTypeOrConfiganychart.enums.AnnotationTypes | string | anychart.core.annotations.AnnotationJSONFormatAnnotation settings.

Returns:

anychart.core.annotations.Base - Annotation instance

andrewsPitchfork

Creates and returns an Andrews Pitchfork annotation.

Params:

NameTypeDescription
settingsObjectAndrews pitchfork settings

Returns:

anychart.core.annotations.AndrewsPitchfork - Andrews pitchfork annotation instance.

cancelDrawing

Cancels annotation drawing.

ellipse

Creates and returns an Ellipse annotation.

Params:

NameTypeDescription
settingsObjectEllipse settings

Returns:

anychart.core.annotations.Ellipse - Ellipse annotation instance.

enabled

Getter for the enabled state.

Returns:

boolean - Enabled state.
Setter for the enabled state.

Params:

NameTypeDescription
enabledbooleanValue to set.

Returns:

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

fibonacciArc

Creates and returns a Fibonacci Arc annotation.

Params:

NameTypeDescription
settingsObjectFibonacci arc settings

Returns:

anychart.core.annotations.FibonacciArc - Fibonacci arc annotation instance.

fibonacciFan

Creates and returns a Fibonacci Fan annotation.

Params:

NameTypeDescription
settingsObjectFibonacci fan settings

Returns:

anychart.core.annotations.FibonacciFan - Fibonacci fan annotation instance.

fibonacciRetracement

Creates and returns a Fibonacci Retracement annotation.

Params:

NameTypeDescription
settingsObjectFibonacci retracement settings

Returns:

anychart.core.annotations.FibonacciRetracement - Fibonacci retracement annotation instance.

fibonacciTimezones

Creates and returns a Fibonacci Timezones annotation.

Params:

NameTypeDescription
settingsObjectFibonacci timezones settings

Returns:

anychart.core.annotations.FibonacciTimezones - Fibonacci timezones annotation instance.

finiteTrendChannel

Creates and returns a Finite Trend Channel annotation.

Params:

NameTypeDescription
settingsObjectFinite trend channel settings

Returns:

anychart.core.annotations.FiniteTrendChannel - Trend channel annotation instance.

fromJson

Creates annotations list by JSON config.

Params:

NameTypeDescription
configObject | stringJSON configuration as object or string.

Returns:

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

fromXml

Creates annotations list by XML config.

Params:

NameTypeDescription
configstring | NodeConfiguration as XML string or XMLNode.

Returns:

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

getAnnotationAt

Returns annotation by index.

Params:

NameTypeDescription
indexnumberIndex of the annotation.

Returns:

anychart.core.annotations.Base - Annotation instance.

getAnnotationsCount

Returns annotations count.

Returns:

number - Number of annotations.

getSelectedAnnotation

Returns selected annotation.

Returns:

anychart.core.annotations.Base - Annotation instance.

horizontalLine

Creates and returns a Horizontal Line annotation.

Params:

NameTypeDescription
settingsObjectHorizontal line settings

Returns:

anychart.core.annotations.HorizontalLine - Horizontal line annotation instance.

horizontalRange

Creates and returns a Horizontal Range annotation.

Params:

NameTypeDescription
settingsObjectHorizontal range settings

Returns:

anychart.core.annotations.HorizontalRange - Horizontal range annotation instance.

infiniteLine

Creates and returns an Infinite Line annotation.

Params:

NameTypeDescription
settingsObjectInfinite line settings.

Returns:

anychart.core.annotations.InfiniteLine - Infinite line annotation instance.

label

Creates and returns a Label annotation.

Params:

NameTypeDescription
settingsObjectLabel annotation settings.

Returns:

anychart.core.annotations.Label - Label annotation instance.

line

Creates and returns a Line annotation.

Params:

NameTypeDescription
settingsObjectLine settings.

Returns:

anychart.core.annotations.Line - Line annotation instance.

marker

Creates and returns a Marker annotation.

Params:

NameTypeDescription
settingsObjectMarker settings

Returns:

anychart.core.annotations.Marker - Marker annotation instance.

ray

Creates and returns a Ray annotation.

Params:

NameTypeDescription
settingsObjectRay settings.

Returns:

anychart.core.annotations.Ray - Ray annotation instance.

rectangle

Creates and returns a Rectangle annotation.

Params:

NameTypeDescription
settingsObjectRectangle settings

Returns:

anychart.core.annotations.Rectangle - Rectangle annotation instance.

removeAllAnnotations

Removes all annotations from a plot.

Returns:

anychart.core.annotations.PlotController - Self for method chaining.

removeAnnotation

Removes an annotation from a plot by its instance.

Params:

NameTypeDescription
annotationanychart.core.annotations.BaseAnnotation instance

Returns:

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

removeAnnotationAt

Removes an annotation from a plot by its index.

Params:

NameTypeDescription
indexnumberAnnotations index.

Returns:

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

select

Selects annotation.

Params:

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

Returns:

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

startDrawing

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

Params:

NameTypeDescription
annotationTypeOrConfiganychart.enums.AnnotationTypes | string | anychart.core.annotations.AnnotationJSONFormatAnnotation settings.

Returns:

anychart.core.annotations.Base - Annotation instance.

toJson

Return plot annotations configuration as JSON object or string.

Params:

NameTypeDefaultDescription
stringifyboolean
false
Returns JSON as string.

Returns:

Object | string - Plot annotations configuration

toXml

Return plot annotations configuration as XML string or XMLNode.

Params:

NameTypeDefaultDescription
asXmlNodeboolean
false
Return XML as XMLNode.

Returns:

string | Node - Plot annotations configuration.

trendChannel

Creates and returns a Trend Channel annotation.

Params:

NameTypeDescription
settingsObjectTrend channel settings

Returns:

anychart.core.annotations.TrendChannel - Trend channel annotation instance.

triangle

Creates and returns a Triangle annotation.

Params:

NameTypeDescription
settingsObjectTriangle settings

Returns:

anychart.core.annotations.Triangle - Triangle annotation instance.

unselect

Unselects annotations.

Returns:

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

verticalLine

Creates and returns a Vertical Line annotation.

Params:

NameTypeDescription
settingsObjectVertical line settings

Returns:

anychart.core.annotations.VerticalLine - Vertical line annotation instance.

verticalRange

Creates and returns a Vertical Range annotation.

Params:

NameTypeDescription
settingsObjectVertical range settings

Returns:

anychart.core.annotations.VerticalRange - Vertical range annotation instance.

zIndex

Getter for the Z-index of the element.

Returns:

number - Z-index.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
zIndexnumber
0
Value to set.

Returns:

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