class anychart.standalones.MarkersFactory Improve this Doc
Extends: anychart.core.ui.MarkersFactory
The MarkersFactory class contains methods for configuring standalones markers factory.
Methods Overview
Specific settings | |
type() | Type settings. |
Coloring | |
fill() | Fill settings. |
stroke() | Stroke settings. |
Interactivity | |
enabled() | Element state (enabled or disabled). |
Size and Position | |
anchor() | Anchor settings. |
offsetX() | Offset by X. |
offsetY() | Offset by Y. |
position() | Position settings. |
positionFormatter() | Position formatter function. |
rotation() | Rotation settings. |
size() | Markers size |
zIndex() | Markers Z-index. |
Miscellaneous | |
add() | Adds new marker and adds it to a set taking positionProvider into account. |
clear() | Clears an array of markers. |
container() | Container for the elements. |
draw() | Markers drawing. |
measure() | Calculates bounds for the marker. |
parentBounds() | Getter for the parent bounds. |
Methods Description
add
Params:
Name | Type | Description |
---|---|---|
positionProvider | * | Object with position settings, it must contain x and y without offsets. Can contain any additional info, if needed. |
index | number | Marker index. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.anchor
Returns:
anychart.enums.Anchor | string - Marker anchor settings.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
anchor | anychart.enums.Anchor | string | 'center' | Value to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
clear
Params:
Name | Type | Description |
---|---|---|
index | number | If set, removes only the marker that is in passed index. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.container
Returns:
anychart.graphics.vector.Layer | anychart.graphics.vector.Stage - An instance of the class for method chaining.Params:
Name | Type | Description |
---|---|---|
element | anychart.graphics.vector.Layer | anychart.graphics.vector.Stage | string | Element | The value to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.draw
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.enabled
Returns:
boolean - Element state.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | null | boolean | null | Enabled state to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
fill
Returns:
anychart.graphics.vector.Fill | string - Markers fill settings.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
color | anychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)> | {color: "#64b5f6", opacity: 1} | Color as an array, an object or a string. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Params:
Name | Type | Description |
---|---|---|
color | string | Color as a string. |
opacity | number | Color opacity. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
Params:
Name | Type | Description |
---|---|---|
keys | Array.<(anychart.graphics.vector.GradientKey|string)> | Gradient keys. |
angle | number | Gradient angle. |
mode | boolean | anychart.graphics.vector.Rect | Object | Gradient mode. |
opacity | number | Gradient opacity. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
Params:
Name | Type | Description |
---|---|---|
keys | Array.<(anychart.graphics.vector.GradientKey|string)> | Color-stop gradient keys. |
cx | number | X ratio of center radial gradient. |
cy | number | Y ratio of center radial gradient. |
mode | anychart.graphics.math.Rect | If defined then userSpaceOnUse mode, else objectBoundingBox. |
opacity | number | Opacity of the gradient. |
fx | number | X ratio of focal point. |
fy | number | Y ratio of focal point. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
Params:
Name | Type | Description |
---|---|---|
imageSettings | anychart.graphics.vector.Fill | Object with settings. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
measure
Params:
Name | Type | Description |
---|---|---|
positionProvider | * | Object with information about marker with current index, it must contain x and y fields (with no offsets taken in account). You can add any custom information of needed. |
Returns:
anychart.math.Rect - Markers bounds.offsetX
Returns:
number | string - Marker offset by X.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
offset | number | string | 0 | Offset by X to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
offsetY
Returns:
number | string - Markers offset by Y.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
offset | number | string | 0 | Offset by Y to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
parentBounds
Bounds that would be used in case of percent size calculations. Expects pixel values only.
Returns:
anychart.math.Rect - The parent bounds of the element.Bounds that would be used in case of percent size calculations. Expects pixel values only.
Params:
Name | Type | Description |
---|---|---|
bounds | anychart.math.Rect | Object | number | null | Bounds to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Bounds that would be used in case of percent size calculations. Expects pixel values only.
Params:
Name | Type | Description |
---|---|---|
left | number | Left space. |
top | number | Top space. |
width | number | Element width. |
height | number | Element height. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.position
Returns:
string - Markers position settings.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
position | string | 'center' | Position to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
positionFormatter
Returns:
function - Marker position formatter function.This method works only for discrete series (bar, column).
Params:
Name | Type | Default | Description |
---|---|---|---|
formatter | function(positionProvider:*, index:number):anychart.math.CoordinateObject | function(positionProvider, index) { return {x: 80 * index, y: 0}; } | Function to position marker depending on index and context, it should look like this:
function(positionProvider, index) { ... //do something return {x: smth, y: smth}; }Parameters: positionProvider - object with information about current (by index) marker position, this object must contain x and y field (with no offsets taken in account). index - current marker index. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
rotation
Returns:
number - Rotation angle in degrees.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
rotation | number | 0 | Rotation angle in degrees. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
size
Params:
Name | Type | Default | Description |
---|---|---|---|
size | number | 10 | Size to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
stroke
Returns:
anychart.graphics.vector.Stroke | string - Markers stroke settings.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
color | anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | 'none' | Color to set. |
Returns:
anychart.standalones.MarkersFactory - 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 | Line thickness. |
dashpattern | string | Controls the pattern of dashes and gaps used to stroke paths. | |
lineJoin | string | anychart.graphics.vector.StrokeLineJoin | Line join style. | |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Style of line cap. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
Params:
Name | Type | Description |
---|---|---|
settings | Object | Stroke settings from anychart.graphics.vector.Stroke. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
type
Returns:
anychart.enums.MarkerType | string | function - Markers type settings.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
type | anychart.enums.MarkerType | string | function | anychart.enums.MarkerType|string#DIAGONAL_CROSS | Type or custom drawer. Function for a custom marker
must look like this: function(path, x, y, size){ // path - anychart.graphics.vector.Path // x, y - current marker position // size - marker size ... //do something return path; |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it:
zIndex
Returns:
number - Chart Z-index.var zIndex = markers.zIndex();
Params:
Name | Type | Default | Description |
---|---|---|---|
zIndex | number | 31.000012 | Z-index to set. |
Returns:
anychart.standalones.MarkersFactory - Self instance for method chaining.Try it: