class anychart.core.ui.Crosshair Improve this Doc
Extends: anychart.core.VisualBase
Crosshair class.
Methods Overview
Specific settings | |
displayMode() | Display mode. |
xLabel() | X-label settings |
yLabel() | Y-label settings |
Coloring | |
xStroke() | X-line stroke settings. |
yStroke() | Y-line stroke settings. |
Interactivity | |
enabled() | Element state (enabled or disabled). |
Size and Position | |
zIndex() | Z-index of the element. |
Methods Description
displayMode
Getter for the crosshair display mode.
Returns:
anychart.enums.CrosshairDisplayMode | string - Crosshair display mode.Try it:
Setter for the display mode for crosshair.
Params:
Name | Type | Description |
---|---|---|
mode | anychart.enums.CrosshairDisplayMode | string | Display mode. 'float' is the default value for Scatter charts, 'sticky' for Stock charts. Note, the display mode isn't used for Cartesian charts. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.Try it:
enabled
Getter for the element state (enabled or disabled).
Returns:
boolean - Element state.Try it:
Setter for the element enabled state.
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enabled state to set. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining. Example.
if (!element.enabled()) element.enabled(true);
Try it:
xLabel
Getter for the crosshair X-label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
index | number | 0 | X-label index. |
Returns:
anychart.core.ui.CrosshairLabel - Crosshair X-label settings.Try it:
Setter for the crosshair X-label settings.
Detailed description
Sets crosshair X-label settings depending on parameter type:
- null/boolean - disable or enable crosshair X-label.
- object - sets crosshair X-label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | Object | boolean | null | true | X-label settings. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.Setter for the crosshair X-label settings by index.
Detailed description
Sets crosshair X-label settings depending on parameter type:
- null/boolean - disable or enable crosshair X-label by index.
- object - sets crosshair X-label settings by index.
Params:
Name | Type | Default | Description |
---|---|---|---|
index | number | 0 | X-label index. |
settings | Object | boolean | null | true | X-label settings. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.xStroke
Getter for the X-line stroke.
Returns:
anychart.graphics.vector.Stroke - X-line stroke settings.Try it:
Setter for the X-line stroke.
Params:
Name | Type | Default | Description |
---|---|---|---|
color | anychart.graphics.vector.Stroke | string | null | '#969EA5' | Stroke settings. |
thickness | number | Line thickness. | |
dashpattern | string | Controls the pattern of dashes and gaps used to stroke paths. | |
lineJoin | string | anychart.graphics.vector.StrokeLineJoin | Line joint style. | |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.Try it:
yLabel
Getter for the crosshair Y-label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
index | number | 0 | Y-label index. |
Returns:
anychart.core.ui.CrosshairLabel - Crosshair Y-label settings.Try it:
Setter for the crosshair Y-label settings.
Detailed description
Sets chart Y-label settings depending on parameter type:
- null/boolean - disable or enable crosshair Y-label.
- object - sets crosshair Y-label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | Object | boolean | null | true | Y-label. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.Setter for the crosshair Y-label settings by index.
Detailed description
Sets crosshair Y-label settings depending on parameter type:
- null/boolean - disable or enable crosshair Y-label.
- object - sets crosshair Y-label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
index | number | 0 | Y-label index. |
settings | Object | boolean | null | true | Y-label |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.yStroke
Getter for the Y-line stroke.
Returns:
anychart.graphics.vector.Stroke - Y-line stroke settings.Try it:
Setter for the Y-line stroke.
Params:
Name | Type | Default | Description |
---|---|---|---|
color | anychart.graphics.vector.Stroke | string | null | '#969EA5' | Stroke settings. |
thickness | number | Line thickness. | |
dashpattern | string | Controls the pattern of dashes and gaps used to stroke paths. | |
lineJoin | string | anychart.graphics.vector.StrokeLineJoin | Line joint style. | |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.Try it:
zIndex
Setter for the Z-index of the element.
Detailed description
The bigger the index - the higher the element position is.
Params:
Name | Type | Default | Description |
---|---|---|---|
zIndex | number | 0 | Value to set. |
Returns:
anychart.core.ui.Crosshair - Self instance for method chaining.Try it: