Top
You are looking at an outdated 7.3.0 version of this document. Switch to the 7.14.3 version to see the up to date information.

class anychart.core.ui.MarkersFactory Improve this Doc

Extends: anychart.core.VisualBase

Multiple markers class.
Multiple markers are the set of markers with a common settings, such as type (predefined or custom), size, fill and position:

Also you can access any marker from the set and change it:

Try it:

Methods Overview

Miscellaneous
anchor()Getter for anchor settings of all markers.
disablePointerEvents()Specifies under what circumstances a given graphics element can be the target element for a pointer event.
enabled()Getter for the current element state.
fill()Getter for current fill settings of all markers.
offsetX()Getter for current offsetX settings of all markers.
offsetY()Getter for current offsetY settings of all markers.
position()Getter for current position settings of all markers.
positionFormatter()Getter for current position formatter function of all markers.
size()Getter for current size settings of all markers.
stroke()Getter for current stroke settings of all markers.
type()Getter for current type settings of all markers.

Methods Description

anchor

Getter for anchor settings of all markers.

Returns:

anychart.enums.Anchor - Current marker anchor settings.
Setter for anchor settings of all markers.

Params:

Name Type Default Description
value anychart.enums.Anchor | string
anychart.enums.Anchor.CENTER
Value to set.

Returns:

anychart.core.ui.MarkersFactory - anychart.core.ui.MarkersFactory instance for method chaining.

Try it:

disablePointerEvents

Specifies under what circumstances a given graphics element can be the target element for a pointer event.

Params:

Name Type Description
value boolean Pointer events property value.

Returns:

anychart.core.ui.MarkersFactory boolean - If opt_value defined then returns Element object for chaining else pointer events property value.

enabled

Getter for the current element state. True, false and null states. True and false are self-explanatory. null state means that element is enabled, but if it depends on other entities (like, for example, markers() and hoverMarkers() in series), then factory works in auto mode. For example, if series normal markers are enabled, and hover markers are in null state, then upon hover hoverMarkers become enabled because of normal. But if you disable normal markers – hoverMarkers are disabled too.

Returns:

boolean - The current element state.
Setter for the element enabled state.

Params:

Name Type Description
value null | boolean Value to set.

Returns:

anychart.MarkersFactory - anychart.core.VisualBase class for method chaining.

Try it:

fill

Getter for current fill settings of all markers.

Returns:

anychart.graphics.vector.Fill string - Markeres fill settings.
Setter for fill settings of all markers.
Note: fill is described at https://docs.anychart.com/7.3.0/General_settings/Elements_Fill

Params:

Name Type Default Description
value anychart.graphics.vector.Fill | string
'black'
Value to set.

Try it:

offsetX

Getter for current offsetX settings of all markers.

Returns:

number string - Marker offsetX settings.
Setter for offsetX settings of all markers.

Params:

Name Type Default Description
value number | string
0
Value to set.

Returns:

anychart.core.ui.MarkersFactory - anychart.core.ui.MarkersFactory instance for method chaining.

Try it:

offsetY

Getter for current offsetY settings of all markers.

Returns:

number string - Markers offsetY settings.
Setter for offsetY settings of all markers.

Params:

Name Type Default Description
value number | string
0
Value to set.

Try it:

position

Getter for current position settings of all markers.

Returns:

string - Markers position settings.
Setter for position settings of all markers.

Params:

Name Type Default Description
value string
anychart.enums.Position.CENTER
Value to set.

Returns:

anychart.core.ui.MarkersFactory - anychart.core.ui.MarkersFactory instance for method chaining.

positionFormatter

Getter for current position formatter function of all markers.

Returns:

function - Marker position formatter function.
Setter for position formatter function of all markers.
Note: you can pass anything to positionProvider using anychart.core.ui.MarkersFactory#draw, this extends positioning options

Params:

Name Type Default Description
value function
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.core.ui.MarkersFactory - anychart.core.ui.MarkersFactory instance for method chaining.

Try it:

size

Getter for current size settings of all markers.

Returns:

number - Markeres size settings.
Setter for size settings of all markers.

Params:

Name Type Default Description
value number
10
Value to set.

Try it:

stroke

Getter for current stroke settings of all markers.

Returns:

anychart.graphics.vector.Stroke string - Markers fill settings.
Setter for stroke settings of all markers.
Note: stroke is described at https://docs.anychart.com/7.3.0/General_settings/Elements_Stroke

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | string
'black'
Value to set.

Try it:

type

Getter for current type settings of all markers.

Returns:

anychart.enums.MarkerType function - Markers type settings.
Setter for type settings of all markers.

Params:

Name Type Default Description
value anychart.enums.MarkerType | function
anychart.enums.MarkerType.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.core.ui.MarkersFactory - anychart.core.ui.MarkersFactory instance for method chaining.

Try it: