class anychart.core.annotations.Ray Improve this Doc
Extends: anychart.core.annotations.Base
Ray annotation.
Methods Overview
Specific settings | |
getPlot() | Returns the plot on which the annotation is drawn. |
getType() | Returns annotation type. |
markers() | Markers settings. |
Axes and Scales | |
xScale() | X-scale settings |
yScale() | Y-scale settings |
Charts | |
getChart() | Returns the chart on which the annotation is drawn. |
Coloring | |
color() | Color settings. |
stroke() | Stroke settings. |
Interactivity | |
allowEdit() | Interactivity settings. |
enabled() | Element state (enabled or disabled). |
hovered() | Hovered state settings. |
normal() | Normal state settings. |
select() | Selects current annotation. |
selected() | Selected state settings. |
Size and Position | |
bottom() | Bottom bound settings. |
bounds() | Bounds settings. |
getPixelBounds() | Returns pixel bounds. |
height() | Height settings. |
hoverGap() | Hover gap settings. |
left() | Left bound settings. |
maxHeight() | Maximum height. |
maxWidth() | Maximum width. |
minHeight() | Minimum height. |
minWidth() | Minimum width. |
right() | Right bound settings. |
secondValueAnchor() | Second value anchor settings |
secondXAnchor() | Second X anchor settings |
top() | Top bound settings. |
valueAnchor() | Value anchor settings |
width() | Width settings. |
xAnchor() | X anchor settings |
zIndex() | Z-index of the element. |
Methods Description
allowEdit
Returns:
boolean - Interactivity settings.var allowEdit = annotation.allowEdit();
Params:
Name | Type | Description |
---|---|---|
value | * | Whether to disable the interactivity in the annotation. If set to false, the interactivity is disabled in the annotation. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
bottom
Returns:
number | string | undefined - Element's bottom bound setting.Params:
Name | Type | Default | Description |
---|---|---|---|
bottom | number | string | null | null | Bottom bound settings for the element. |
Returns:
anychart.core.annotations.Ray - Returns self for method chaining.Try it:
bounds
Returns:
anychart.core.utils.Bounds - Bounds of the element.Params:
Name | Type | Description |
---|---|---|
bounds | anychart.utils.RectObj | anychart.math.Rect | anychart.core.utils.Bounds | Bounds of element. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
x | number | string | null | X-coordinate. |
y | number | string | null | Y-coordinate. |
width | number | string | null | Width. |
height | number | string | null | Height. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
color
Returns:
string - The annotation color.var color = annotation.color();
Learn more about coloring.
Params:
Name | Type | Description |
---|---|---|
color | string | Color as a string. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
enabled
Returns:
boolean - Element state.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enabled state to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.if (!element.enabled()) element.enabled(true);
Try it:
getChart
Returns:
anychart.core.SeparateChart - Chart.Try it:
getPixelBounds
Returns:
anychart.math.Rect - Pixel bounds of the element.getPlot
Returns:
anychart.core.stock.Plot - Stock plot.Try it:
getType
height
Returns:
number | string | undefined - Element's height setting.Params:
Name | Type | Default | Description |
---|---|---|---|
height | number | string | null | null | Height settings for the element. |
Returns:
anychart.core.annotations.Ray - Returns self for method chaining.Try it:
hoverGap
Returns:
number - The hover gap value.var hoverGap = annotation.hoverGap();
The contour size around annotation.
Params:
Name | Type | Description |
---|---|---|
value | * | Value to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
hovered
Returns:
anychart.core.StateSettings - Hovered state settingsTry it:
Params:
Name | Type | Description |
---|---|---|
settings | Object | State settings to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
left
Returns:
number | string | undefined - Element's left bound setting.Params:
Name | Type | Default | Description |
---|---|---|---|
left | number | string | null | null | Left bound setting for the element. |
Returns:
anychart.core.annotations.Ray - Returns self for method chaining.Try it:
markers
- null/boolean - disable or enable annotation markers.
- object - sets annotation markers settings.
- string - sets annotation markers type.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | Object | boolean | null | string | false | Data markers settings. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.maxHeight
Returns:
number | string | null - Element's maximum height.Params:
Name | Type | Default | Description |
---|---|---|---|
height | number | string | null | null | Maximum height to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
maxWidth
Returns:
number | string | null - Element's maximum width.Params:
Name | Type | Default | Description |
---|---|---|---|
width | number | string | null | null | Maximum width to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
minHeight
Returns:
number | string | null - Element's minimum height.Params:
Name | Type | Default | Description |
---|---|---|---|
height | number | string | null | null | Minimum height to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
minWidth
Returns:
number | string | null - Element's minimum width.Params:
Name | Type | Default | Description |
---|---|---|---|
width | number | string | null | null | Minimum width to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
normal
Returns:
anychart.core.StateSettings - Normal state settings.Try it:
Params:
Name | Type | Description |
---|---|---|
settings | Object | State settings to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
right
Returns:
number | string | undefined - Element's right bound setting.Params:
Name | Type | Default | Description |
---|---|---|---|
right | number | string | null | null | Right bound setting for the element. |
Returns:
anychart.core.annotations.Ray - Returns self for method chaining.Try it:
secondValueAnchor
Returns:
* - The second value anchor.var controller = chart.annotations(); var annotation = controller.ray(); var secondValueAnchor = annotation.secondValueAnchor();
Params:
Name | Type | Description |
---|---|---|
value | * | Second value anchor to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
secondXAnchor
Returns:
* - The second X anchor.var controller = chart.annotations(); var annotation = controller.ray(); var secondXAnchor = annotation.secondXAnchor();
Params:
Name | Type | Description |
---|---|---|
Second | * | X anchor to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
select
Try it:
selected
Returns:
anychart.core.StateSettings - Selected state settingsTry it:
Params:
Name | Type | Description |
---|---|---|
settings | Object | State settings to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
stroke
Returns:
anychart.graphics.vector.Stroke - Stroke settings.var stroke = annotation.stroke();
Params:
Name | Type | Default | Description |
---|---|---|---|
strokeFunction | function():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill | function() { return anychart.color.darken(this.sourceColor); } | Function that looks like: function(){ // this.index - series index. // this.sourceColor - color returned by fill() getter. // this.iterator - series point iterator. return strokeValue; // type anychart.graphics.vector.Stroke or anychart.graphics.vector.ColoredFill } |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
color | anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null | Stroke settings. | |
thickness | number | 1 | Ray thickness. |
dashpattern | string | Controls the pattern of dashes and gaps used to stroke paths. | |
lineJoin | string | anychart.graphics.vector.StrokeLineJoin | Ray join style. | |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Ray cap style. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
Params:
Name | Type | Description |
---|---|---|
settings | Object | Object with stroke settings from anychart.graphics.vector.Stroke |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
top
Returns:
number | string | undefined - Element's top bound setting.Params:
Name | Type | Default | Description |
---|---|---|---|
top | number | string | null | null | Top bound setting for the element. |
Returns:
anychart.core.annotations.Ray - Returns self for method chaining.Try it:
valueAnchor
Returns:
* - The value anchor.var controller = chart.annotations(); var annotation = controller.ray(); var valueAnchor = annotation.valueAnchor();
Params:
Name | Type | Description |
---|---|---|
value | * | Value anchor to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
width
Returns:
number | string | undefined - Element's width setting.Params:
Name | Type | Default | Description |
---|---|---|---|
width | number | string | null | null | Width settings for the element. |
Returns:
anychart.core.annotations.Ray - Returns self for method chaining.Try it:
xAnchor
Returns:
* - The X anchor.var controller = chart.annotations(); var annotation = controller.ray(); var xAnchor = annotation.xAnchor();
Params:
Name | Type | Description |
---|---|---|
value | * | X anchor to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
xScale
Returns:
anychart.scales.Ordinal | anychart.scales.Linear | anychart.scales.Logarithmic | anychart.scales.StockScatterDateTime - Default scale value.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | anychart.scales.Base | anychart.scales.StockScatterDateTime | Object | anychart.enums.ScaleTypes | string | anychart.scales.Linear | Value to set |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
yScale
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | anychart.scales.Base | Object | anychart.enums.ScaleTypes | string | anychart.scales.Linear | Y-scale to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it:
zIndex
Params:
Name | Type | Default | Description |
---|---|---|---|
zIndex | number | 0 | Value to set. |
Returns:
anychart.core.annotations.Ray - Self instance for method chaining.Try it: