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
Params:
Name | Type | Description |
---|---|---|
annotationTypeOrConfig | anychart.enums.AnnotationTypes | string | anychart.core.annotations.AnnotationJSONFormat | Annotation settings. |
Returns:
anychart.core.annotations.Base - Annotation instanceTry it:
andrewsPitchfork
Params:
Name | Type | Description |
---|---|---|
settings | Object | Andrews pitchfork settings |
Returns:
anychart.core.annotations.AndrewsPitchfork - Andrews pitchfork annotation instance.Try it:
cancelDrawing
Try it:
ellipse
Params:
Name | Type | Description |
---|---|---|
settings | Object | Ellipse settings |
Returns:
anychart.core.annotations.Ellipse - Ellipse annotation instance.Try it:
enabled
Returns:
boolean - Enabled state.Params:
Name | Type | Description |
---|---|---|
enabled | boolean | Value to set. |
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.Try it:
fibonacciArc
Params:
Name | Type | Description |
---|---|---|
settings | Object | Fibonacci arc settings |
Returns:
anychart.core.annotations.FibonacciArc - Fibonacci arc annotation instance.Try it:
fibonacciFan
Params:
Name | Type | Description |
---|---|---|
settings | Object | Fibonacci fan settings |
Returns:
anychart.core.annotations.FibonacciFan - Fibonacci fan annotation instance.Try it:
fibonacciRetracement
Params:
Name | Type | Description |
---|---|---|
settings | Object | Fibonacci retracement settings |
Returns:
anychart.core.annotations.FibonacciRetracement - Fibonacci retracement annotation instance.Try it:
fibonacciTimezones
Params:
Name | Type | Description |
---|---|---|
settings | Object | Fibonacci timezones settings |
Returns:
anychart.core.annotations.FibonacciTimezones - Fibonacci timezones annotation instance.Try it:
finiteTrendChannel
Params:
Name | Type | Description |
---|---|---|
settings | Object | Finite trend channel settings |
Returns:
anychart.core.annotations.FiniteTrendChannel - Trend channel annotation instance.Try it:
fromJson
Params:
Name | Type | Description |
---|---|---|
config | Object | string | JSON configuration as object or string. |
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.fromXml
Params:
Name | Type | Description |
---|---|---|
config | string | Node | Configuration as XML string or XMLNode. |
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.getAnnotationAt
Params:
Name | Type | Description |
---|---|---|
index | number | Index of the annotation. |
Returns:
anychart.core.annotations.Base - Annotation instance.Try it:
getAnnotationsCount
getSelectedAnnotation
horizontalLine
Params:
Name | Type | Description |
---|---|---|
settings | Object | Horizontal line settings |
Returns:
anychart.core.annotations.HorizontalLine - Horizontal line annotation instance.Try it:
horizontalRange
Params:
Name | Type | Description |
---|---|---|
settings | Object | Horizontal range settings |
Returns:
anychart.core.annotations.HorizontalRange - Horizontal range annotation instance.Try it:
infiniteLine
Params:
Name | Type | Description |
---|---|---|
settings | Object | Infinite line settings. |
Returns:
anychart.core.annotations.InfiniteLine - Infinite line annotation instance.Try it:
label
Params:
Name | Type | Description |
---|---|---|
settings | Object | Label annotation settings. |
Returns:
anychart.core.annotations.Label - Label annotation instance.Try it:
line
Params:
Name | Type | Description |
---|---|---|
settings | Object | Line settings. |
Returns:
anychart.core.annotations.Line - Line annotation instance.Try it:
marker
Params:
Name | Type | Description |
---|---|---|
settings | Object | Marker settings |
Returns:
anychart.core.annotations.Marker - Marker annotation instance.Try it:
ray
Params:
Name | Type | Description |
---|---|---|
settings | Object | Ray settings. |
Returns:
anychart.core.annotations.Ray - Ray annotation instance.Try it:
rectangle
Params:
Name | Type | Description |
---|---|---|
settings | Object | Rectangle settings |
Returns:
anychart.core.annotations.Rectangle - Rectangle annotation instance.Try it:
removeAllAnnotations
Returns:
anychart.core.annotations.PlotController - Self for method chaining.Try it:
removeAnnotation
Params:
Name | Type | Description |
---|---|---|
annotation | anychart.core.annotations.Base | Annotation instance |
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.Try it:
removeAnnotationAt
Params:
Name | Type | Description |
---|---|---|
index | number | Annotations index. |
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.Try it:
select
Params:
Name | Type | Description |
---|---|---|
annotation | anychart.core.annotations.Base | Annotation instance to set. |
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.Try it:
startDrawing
Note: Works only after anychart.charts.Cartesian#draw and anychart.charts.Stock#draw is called.
Params:
Name | Type | Description |
---|---|---|
annotationTypeOrConfig | anychart.enums.AnnotationTypes | string | anychart.core.annotations.AnnotationJSONFormat | Annotation settings. |
Returns:
anychart.core.annotations.Base - Annotation instance.Try it:
toJson
Params:
Name | Type | Default | Description |
---|---|---|---|
stringify | boolean | false | Returns JSON as string. |
Returns:
Object | string - Plot annotations configurationtoXml
Params:
Name | Type | Default | Description |
---|---|---|---|
asXmlNode | boolean | false | Return XML as XMLNode. |
Returns:
string | Node - Plot annotations configuration.trendChannel
Params:
Name | Type | Description |
---|---|---|
settings | Object | Trend channel settings |
Returns:
anychart.core.annotations.TrendChannel - Trend channel annotation instance.Try it:
triangle
Params:
Name | Type | Description |
---|---|---|
settings | Object | Triangle settings |
Returns:
anychart.core.annotations.Triangle - Triangle annotation instance.Try it:
unselect
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.Try it:
verticalLine
Params:
Name | Type | Description |
---|---|---|
settings | Object | Vertical line settings |
Returns:
anychart.core.annotations.VerticalLine - Vertical line annotation instance.Try it:
verticalRange
Params:
Name | Type | Description |
---|---|---|
settings | Object | Vertical range settings |
Returns:
anychart.core.annotations.VerticalRange - Vertical range annotation instance.Try it:
zIndex
Params:
Name | Type | Default | Description |
---|---|---|---|
zIndex | number | 0 | Value to set. |
Returns:
anychart.core.annotations.PlotController - Self instance for method chaining.Try it: