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

class anychart.core.cartesian.series.Marker Improve this Doc

Extends: anychart.core.cartesian.series.Base

Define Marker series type.
Note: Use method anychart.charts.Cartesian#marker to get this series.

Methods Overview

Miscellaneous
fill()Getter for current series fill color.
hatchFill()Getter for current hatch fill settings.
hoverFill()Getter for current series fill color on hover state.
hoverHatchFill()Getter for current hover hatch fill settings.
hoverSize()Getter for hovered marker size
hoverStroke()Getter for current stroke settings on hover state.
hoverType()Getter for current hovered marker type settings.
size()Getter for marker size.
stroke()Getter for current stroke settings.
type()Getter for current marker type settings.
unhover()Removes hover from the series point or series.

Methods Description

fill

Getter for current series fill color.

Returns:

anychart.graphics.vector.Fill - The current fill color.

Try it:

Sets fill settings using an object or a string. Learn more about coloring.

Params:

Name Type Description
value anychart.graphics.vector.Fill Color as an object or a string.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.
Sets fill settings using function.

Params:

Name Type Default Description
fillFunction function
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 fillValue; // type anychart.graphics.vector.Fill }.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Fill color with opacity.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Linear gradient fill. Learn more about coloring.

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.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Radial gradient fill. Learn more about coloring.

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.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

hatchFill

Getter for current hatch fill settings.

Returns:

anychart.graphics.vector.PatternFill anychart.graphics.vector.HatchFill function - The current hatch fill.

Try it:

Setter for hatch fill settings. Learn more about hatch fill settings.

Params:

Name Type Description
patternFillOrType anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string PatternFill or HatchFill instance or type of hatch fill.
color string Color.
thickness number Thickness.
size number Pattern size.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

hoverFill

Getter for current series fill color on hover state.

Returns:

anychart.graphics.vector.Fill - The current fill color.

Try it:

Sets fill settings on hover state using an object or a string. Learn more about coloring.

Params:

Name Type Description
value anychart.graphics.vector.Fill Color as an object or a string.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.
Sets fill settings on hover state using function.

Params:

Name Type Default Description
fillFunction function
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 fillValue; // type anychart.graphics.vector.Fill }.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Fill color on hover state with opacity.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Linear gradient fill on hover state. Learn more about coloring.

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.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Radial gradient fill on hover state. Learn more about coloring.

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.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

Image fill on hover state. Learn more about coloring.

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

hoverHatchFill

Getter for current hover hatch fill settings.

Returns:

anychart.graphics.vector.PatternFill anychart.graphics.vector.HatchFill function - The current hover hatch fill.

Try it:

Setter for hover hatch fill settings. Learn more about hatch fill settings.

Params:

Name Type Description
patternFillOrType anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string PatternFill or HatchFill instance or type of hatch fill.
color string Color.
thickness number Thickness.
size number Pattern size.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

hoverSize

Getter for hovered marker size

Returns:

number - The current hovered marker size.

Try it:

Setter for hovered marker size.

Params:

Name Type Default Description
value number
12
Value to set.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

hoverStroke

Getter for current stroke settings on hover state.

Returns:

anychart.graphics.vector.Stroke - The current stroke settings.

Try it:

Setter for series stroke on hover state by function.

Params:

Name Type Default Description
strokeFunction function
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.cartesian.series.Marker - Self instance for method chaining.

Try it:

Setter for stroke settings on hover state.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

hoverType

Getter for current hovered marker type settings.

Returns:

string anychart.enums.MarkerType function - The current markers type settings.

Try it:

Setter for hovered marker type settings.

Params:

Name Type Default Description
value string | anychart.enums.MarkerType | function
anychart.enums.MarkerType.STAR5
Type or custom drawer. Function for a custom marker should look like this: function(path, x, y, size){ // path - anychart.graphics.vector.Path // x, y - marker position // size - marker size ... //do something return path; }.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

size

Getter for marker size.

Returns:

number - The current marker size.

Try it:

Setter for marker size.

Params:

Name Type Default Description
value number
10
Value to set.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

stroke

Getter for current stroke settings.

Returns:

anychart.graphics.vector.Stroke - The current stroke settings.

Try it:

Setter for series stroke by function.

Params:

Name Type Default Description
strokeFunction function
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.cartesian.series.Marker - Self instance for method chaining.

Try it:

Setter for stroke settings. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it:

type

Getter for current marker type settings.

Returns:

string anychart.enums.MarkerType function - The current markers type settings.

Try it:

Setter for marker type settings.

Params:

Name Type Default Description
value string | anychart.enums.MarkerType | function
@link anychart.enums.MarkerType#STAR5
Type or custom drawer. Function for a custom marker should look like this: function(path, x, y, size){ // path - anychart.graphics.vector.Path // x, y - marker position // size - marker size ... //do something return path; }.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

unhover

Removes hover from the series point or series.

Returns:

anychart.core.cartesian.series.Marker - Self instance for method chaining.

Try it: