AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.stock.eventMarkers.Controller Improve this Doc

Extends: anychart.core.Base

Chart event markers controller. Common settings for all event markers.

Methods Overview

Specific settings
format()Function to format content text.
group()Group settings.
seriesId()Series id.
Coloring
fill()Fill settings.
stroke()Stroke settings.
Content Text Settings
disablePointerEvents()Pointer events settings.
fontColor()Font color settings.
fontDecoration()Font decoration setting.
fontFamily()Font family settings.
fontOpacity()Font opacity settings.
fontSize()Font size settings.
fontStyle()Font style settings.
fontVariant()Font variant settings.
fontWeight()Font weight settings.
hAlign()Text horizontal align settings.
letterSpacing()Text letter spacing settings.
lineHeight()Text line height setting.
selectable()Text selectable option.
textDirection()Text direction settings.
textIndent()Text indent settings.
textOverflow()Text overflow settings.
useHtml()Use HTML option.
vAlign()Text vertical align settings.
wordBreak()Word break mode.
wordWrap()Word-wrap mode.
Data
data()Data settings.
Events
listen()Adds an event listener.
listenOnce()Adds a single time event listener.
removeAllListeners()Removes all listeners.
unlisten()Removes the listener.
unlistenByKey()Removes the listener by the key.
Interactivity
hovered()Hovered state settings.
normal()Normal state settings.
selected()Selected state settings.
tooltip()Tooltip settings.
Series
fieldName()Field name.
type()Marker type settings.
Size and Position
connector()Connector settings.
direction()Direction settings.
fontPadding()Font padding settings.
height()Markers height in pixels or percentages.
position()Position settings.
width()Markers width in pixels or percentages.
Text Settings
adjustFontSize()Adjusting settings.
maxFontSize()Maximum font size settings.
minFontSize()Minimum font size settings.

Methods Description

adjustFontSize

Getter for the adjusting font size.

Returns:

number - An adjusted font size.
See listing
var adjustFontSize = eventMarkers.adjustFontSize();
Setter for the adjusting font size.

Params:

Name Type Default Description
adjustOrAdjustByWidth boolean | Array.<boolean> | Object
true
Font needs to be adjusted in case of 1 argument and adjusted by width in case of 2 arguments.
adjustByHeight boolean
Font needs to be adjusted by height.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

connector

Getter for connector settings.

Returns:

anychart.core.utils.Connector - Connector settings.
Setter for the connector length.

Params:

Name Type Description
value Object Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

data

Getter for data of a group with index 0 of the chart.

Returns:

anychart.data.TableMapping anychart.data.Table Array.<Array.<*>> string - Group data.
Setter for data of a group with index 0 of the chart.

Params:

Name Type Description
value anychart.data.TableMapping | anychart.data.Table | Array.<Array.<*>> | string

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

direction

Getter for the direction.

Returns:

anychart.enums.EventMarkerDirection string - Event markers direction.
See listing
var direction = eventMarkers.direction();
Setter for the direction.

Params:

Name Type Default Description
value anychart.enums.EventMarkerDirection | string
"auto"
Direction to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

disablePointerEvents

Getter for the pointer events settings.

Returns:

boolean - The pointer events settings.
See listing
var disablePointerEvents = eventMarkers.disablePointerEvents();
Setter for the pointer events setting.

Params:

Name Type Default Description
value boolean
false
Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fieldName

Getter for the fieldName.

Returns:

string - Field name.
See listing
var fieldName = eventMarkers.fieldName();
Setter for the fieldName.
Note: Sets a series field name for all anychart.core.stock.eventMarkers.Controller#position values with exception of "axis" value.

Params:

Name Type Default Description
value string
"value"
Field name to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fill

Getter for the fill color.

Returns:

anychart.graphics.vector.Fill function - Fill color.
See listing
var fill = eventMarkers.fill();
Setter for fill settings using an array or a string. Learn more about coloring.

Params:

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

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.
Setter for fill settings using function.

Params:

Name Type Default Description
fillFunction function
function() {
 return anychart.color.darken(this.sourceColor);
}
Function that looks like:
function(){
  // this.chart - chart object.
   // this.group - group object.
   // this.index - series index.
   // this.iterator - series point iterator.
   // this.plot - plot object.
   // this.sourceColor - color returned by stroke() getter.
   return fillValue; // type anychart.graphics.vector.Fill
}

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

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

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.
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.stock.eventMarkers.Controller - Self instance for method chaining.
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.stock.eventMarkers.Controller - Self instance for method chaining.

Params:

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

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontColor

Getter for font color settings.

Returns:

string - Font color settings.
See listing
var fontColor = eventMarkers.fontColor();
Setter for font color settings.

Params:

Name Type Description
value string Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontDecoration

Getter for font decoration settings.

Returns:

anychart.graphics.vector.Text.Decoration string - Font decoration settings.
See listing
var fontDecoration = eventMarkers.fontDecoration();
Setter for font decoration settings.

Params:

Name Type Description
value anychart.graphics.vector.Text.Decoration | string Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontFamily

Getter for font family settings.

Returns:

string - Font family settings.
See listing
var fontFamily = eventMarkers.fontFamily();
Setter for font family settings.

Params:

Name Type Description
value string Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontOpacity

Getter for font opacity settings.

Returns:

number - Font opacity settings.
See listing
var fontOpacity = eventMarkers.fontOpacity();
Setter for font opacity settings.

Params:

Name Type Description
value number Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontPadding

Getter for the font padding.

Returns:

number string - Font padding.
See listing
var fontPadding = eventMarkers.fontPadding();
Setter for the font padding.

Params:

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

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontSize

Getter for font size settings.

Returns:

number - Font size settings.
See listing
var fontSize = eventMarkers.fontSize();
Setter for font size settings.

Params:

Name Type Description
value number | string Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontStyle

Getter for font style settings.

Returns:

anychart.graphics.vector.Text.FontStyle string - Font style settings.
See listing
var fontStyle = eventMarkers.fontStyle();
Setter for font style settings.

Params:

Name Type Description
value string | anychart.graphics.vector.Text.FontStyle Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontVariant

Getter for font variant settings.

Returns:

anychart.graphics.vector.Text.FontVariant string - Font variant settings.
See listing
var fontVariant = eventMarkers.fontVariant();
Setter for font variant settings.

Params:

Name Type Description
value string | anychart.graphics.vector.Text.FontVariant Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

fontWeight

Getter for font weight settings.

Returns:

string number - Font weight settings.
See listing
var fontWeight = eventMarkers.fontWeight();
Setter for font weight settings.

Params:

Name Type Description
value string | number Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

format

Getter for the function content text for the tooltip.

Returns:

function string - Function to format title text.
See listing
var format = eventMarkers.format();
Setter for function content text for the tooltip.

Params:

Name Type Description
value function | string Function or string token to format content text.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

group

Getter for the group.

Params:

Name Type Description
indexOrValue number Group index.

Returns:

anychart.core.stock.eventMarkers.Group - Group instance by index.
Setter for the group.

Params:

Name Type Description
value Object | Array | boolean | null Group settings to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.
Setter for the group by index.

Params:

Name Type Description
index number Index of a group.
value Object | Array | boolean | null Group settings to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

hAlign

Getter for horizontal align settings.

Returns:

anychart.graphics.vector.Text.HAlign string - Horizontal align settings.
See listing
var hAlign = eventMarkers.hAlign();
Setter for the horizontal align settings.

Params:

Name Type Description
value string | anychart.graphics.vector.Text.HAlign Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

height

Getter for the markers height.

Returns:

string number - Markers height.
See listing
var height = eventMarkers.height();
Setter for the markers height.

Params:

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

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

hovered

Getter for hovered state settings.

Returns:

anychart.core.StateSettings - Hovered state settings
Setter for hovered state settings.

Params:

Name Type Description
value Object State settings to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

letterSpacing

Getter for text letter spacing settings.

Returns:

number - Letter spacing settings.
See listing
var letterSpacing = eventMarkers.letterSpacing();
Setter for text letter spacing settings.

Params:

Name Type Description
value number Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

lineHeight

Getter for line height settings.

Returns:

number string - Line height settings.
See listing
var lineHeight = eventMarkers.lineHeight();
Setter for line height settings.

Params:

Name Type Description
value number | string Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

listen

Adds an event listener to an implementing object.

Params:

Name Type Default Description
type string
The event type id.
listener function(e:Object)
Callback method. Function that looks like:
function(event){
   // event.actualTarget - actual event target
   // event.currentTarget - current event target
   // event.iterator - event iterator
   // event.originalEvent - original event
   // event.point - event point
   // event.pointIndex - event point index
}
useCapture boolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScope Object
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

listenOnce

Adds an event listener to an implementing object.

Params:

Name Type Default Description
type string
The event type id.
listener function(e:Object)
Callback method.
useCapture boolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScope Object
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

maxFontSize

Getter for maximum font size settings for adjust text from.

Returns:

number - Maximum font size.
See listing
var maxFontSize = eventMarkers.maxFontSize();
Setter for maximum font size settings for adjust text from.

Params:

Name Type Description
value number | string Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

minFontSize

Getter for minimum font size settings for adjust text from.

Returns:

number - Minimum font size.
See listing
var minFontSize = eventMarkers.minFontSize();
Setter for minimum font size settings for adjust text from.

Params:

Name Type Description
value number | string Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

normal

Getter for normal state settings.

Returns:

anychart.core.StateSettings - Normal state settings.
Setter for normal state settings.

Params:

Name Type Description
value Object State settings to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

position

Getter for the position.

Returns:

anychart.enums.EventMarkerPosition string - Event markers position.
See listing
var position = eventMarkers.position();
Setter for the position.

Params:

Name Type Default Description
value anychart.enums.EventMarkerPosition | string
"axis"
Position to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

removeAllListeners

Removes all listeners from an object. You can also optionally remove listeners of some particular type.

Params:

Name Type Description
type string Type of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

Try it:

selectable

Getter for the text selectable option.

Returns:

boolean - Text selectable value.
See listing
var selectable = eventMarkers.selectable();
Setter for the text selectable option.

Params:

Name Type Default Description
value boolean
false
Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

selected

Getter for selected state settings.

Returns:

anychart.core.StateSettings - Selected state settings
Setter for selected state settings.

Params:

Name Type Description
value Object State settings to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

seriesId

Getter for the seriesId.

Returns:

string - Series id.
See listing
var seriesId = eventMarkers.seriesId();
Setter for the seriesId.
Note: Sets a series by id for all anychart.core.stock.eventMarkers.Controller#position values with exception of "axis" value.

Params:

Name Type Default Description
value string
"0"
Series id to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

stroke

Getter for stroke settings.

Returns:

anychart.graphics.vector.Stroke - Stroke settings.
See listing
var stroke = eventMarkers.stroke();
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.chart - chart object.
   // this.group - group object.
   // this.index - series index.
   // this.iterator - series point iterator.
   // this.plot - plot object.
   // this.sourceColor - color returned by stroke() getter.

   return strokeValue; // type anychart.graphics.vector.Stroke
}

Returns:

anychart.core.map.series.Base - Self instance for method chaining.
Setter for series stroke settings. Learn more about stroke settings.

Params:

Name Type Default Description
color anychart.graphics.vector.Stroke | 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
Line cap style.

Returns:

anychart.core.map.series.Base - Self instance for method chaining.

textDirection

Getter for the text direction settings.

Returns:

anychart.graphics.vector.Text.Direction string - Text direction settings.
See listing
var textDirection = eventMarkers.textDirection();
Setter for text direction settings.

Params:

Name Type Description
value string | anychart.graphics.vector.Text.Direction Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

textIndent

Getter for text-indent settings.

Returns:

number - Text indent settings.
See listing
var textIndent = eventMarkers.textIndent();
Setter for text-indent settings.

Params:

Name Type Description
value number Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

textOverflow

Getter for text overflow settings.

Returns:

anychart.graphics.vector.Text.TextOverflow string - Text overflow settings
See listing
var textOverflow = eventMarkers.textOverflow();
Setter for text overflow settings.

Params:

Name Type Description
value anychart.graphics.vector.Text.TextOverflow | string Value to set

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

tooltip

Getter for tooltip settings.

Returns:

anychart.core.ui.Tooltip - Tooltip instance.
Setter for tooltip settings.

Params:

Name Type Default Description
value Object | boolean | null
true
Tooltip settings.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

type

Getter for the marker type.

Returns:

anychart.enums.EventMarkerType string - Marker type.
See listing
var type = eventMarkers.type();
Setter for the marker type.

Params:

Name Type Default Description
value string | anychart.enums.EventMarkerType
"circle"
Marker type to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

unlisten

Removes a listener added using listen() or listenOnce() methods.

Params:

Name Type Default Description
type string
The event type id.
listener function
Callback method.
useCapture boolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScope Object
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

Try it:

unlistenByKey

Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().

Params:

Name Type Description
key Object The key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

Try it:

useHtml

Getter for the useHTML flag.

Returns:

boolean - UseHTML flag.
See listing
var useHtml = eventMarkers.useHtml();
Setter for the useHTML flag.

Params:

Name Type Description
value boolean Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

vAlign

Getter for text vertical align settings.

Returns:

anychart.graphics.vector.Text.VAlign string - Vertical align.
See listing
var vAlign = eventMarkers.vAlign();
Setter for text vertical align settings.

Params:

Name Type Description
value string | anychart.graphics.vector.Text.VAlign Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

width

Getter for the markers width.

Returns:

string number - Markers width.
See listing
var width = eventMarkers.width();
Setter for the markers width.

Params:

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

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

wordBreak

Getter for the word-break mode.

Returns:

anychart.enums.WordBreak string - Word-break mode.
See listing
var wordBreak = eventMarkers.wordBreak();
Setter for the word-break mode.

Params:

Name Type Default Description
value anychart.enums.WordBreak | string
"normal"
Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.

wordWrap

Getter for the word-wrap mode.

Returns:

anychart.enums.WordWrap string - Word-wrap mode.
See listing
var wordWrap = eventMarkers.wordWrap();
Setter for the word-wrap mode.

Params:

Name Type Default Description
value anychart.enums.WordWrap | string
"normal"
Value to set.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.