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.
stickToLeft()Whether event markers that do not correspond to any timestamps in data sets are placed to the assigned timestamps or moved left.
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.
textShadow()Text shadow settings.
useHtml()Use HTML option.
vAlign()Text vertical align settings.
wordBreak()Word break mode.
wordWrap()Word-wrap mode.
Data
data()Data settings.
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.
zIndex()Z-index of the element.
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:

NameTypeDefaultDescription
adjustOrAdjustByWidthboolean | Array.<boolean> | Object
true
Font needs to be adjusted in case of 1 argument and adjusted by width in case of 2 arguments.
adjustByHeightboolean
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 settings.

Params:

NameTypeDescription
settingsObjectConnector settings 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:

NameTypeDescription
dataanychart.data.TableMapping | anychart.data.Table | Array.<Array.<*>> | stringGroup data.

Returns:

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

direction

Getter for the direction.

Returns:

anychart.enums.Direction | string - Event markers direction.
See listing
var direction = eventMarkers.direction();
Setter for the direction.
Note: Accepts only 'up', 'down' and 'auto' values.

Params:

NameTypeDefaultDescription
directionanychart.enums.Direction | 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:

NameTypeDefaultDescription
enabledboolean
false
Enabled state 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:

NameTypeDefaultDescription
namestring
'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 function.

Params:

NameTypeDefaultDescription
fillFunctionfunction():anychart.graphics.vector.Fill
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:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity (0 to 1).

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.stock.eventMarkers.Controller - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

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

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject 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:

NameTypeDescription
colorstringFont color 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:

NameTypeDescription
typeanychart.graphics.vector.Text.Decoration | stringFont decoration 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:

NameTypeDescription
familystringFont family 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:

NameTypeDescription
opacitynumberOpacity 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:

NameTypeDefaultDescription
paddingnumber | 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:

NameTypeDescription
sizenumber | stringFont size 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:

NameTypeDescription
stylestring | anychart.graphics.vector.Text.FontStyleFont style 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:

NameTypeDescription
valuestring | anychart.graphics.vector.Text.FontVariantValue 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:

NameTypeDescription
weightstring | numberFont weight 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:

NameTypeDescription
formatfunction | stringFunction or string token to format content text.

Returns:

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

group

Getter for the group.

Params:

NameTypeDescription
indexOrValuenumberGroup index.

Returns:

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

Params:

NameTypeDescription
settingsObject | Array | boolean | nullGroup settings to set.

Returns:

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

Params:

NameTypeDescription
indexnumberIndex of a group.
settingsObject | Array | boolean | nullGroup 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:

NameTypeDescription
alignstring | anychart.graphics.vector.Text.HAlignHorizontal align 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:

NameTypeDescription
heightstring | numberMarkers height 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:

NameTypeDescription
settingsObjectState 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:

NameTypeDescription
spacingnumberLetter spacing 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:

NameTypeDescription
heightnumber | stringLine height to set.

Returns:

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

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:

NameTypeDescription
sizenumber | stringMaximum font size 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:

NameTypeDescription
sizenumber | stringMinimum font size 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:

NameTypeDescription
settingsObjectState 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:

NameTypeDefaultDescription
positionanychart.enums.EventMarkerPosition | string
'axis'
Position to set.

Returns:

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

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:

NameTypeDefaultDescription
enabledboolean
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:

NameTypeDescription
settingsObjectState 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:

NameTypeDefaultDescription
idstring
'0'
Series id to set.

Returns:

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

stickToLeft

Getter for sticking event markers to left value.

Returns:

boolean - Event markers sticks to left value or no.
See listing
var eventMarkers = plot.eventMarkers();
var stickToLeft = eventMarkers.stickToLeft();
Setter for sticking event markers to left value.

Params:

NameTypeDefaultDescription
enabledboolean
true
Whether event markers to stick to left value.

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:

NameTypeDefaultDescription
strokeFunctionfunction():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill
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:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapstring | anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.map.series.Base - Self instance for method chaining.
Setter for stroke using an object.

Params:

NameTypeDescription
settingsObjectStroke settings from anychart.graphics.vector.Stroke.

Returns:

anychart.core.stock.eventMarkers.Controller - 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:

NameTypeDescription
valuestring | anychart.graphics.vector.Text.DirectionValue 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:

NameTypeDescription
indentnumberText indent 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:

NameTypeDescription
valueanychart.graphics.vector.Text.TextOverflow | stringValue to set

Returns:

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

textShadow

Getter for text shadow settings.

Returns:

string - String representation of text shadow.
See listing
var textShadow = eventMarkers.textShadow();
Setter for text shadow settings.

Params:

NameTypeDefaultDescription
textShadowanychart.graphics.vector.TextShadow | string
'none'
Text shadow 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:

NameTypeDefaultDescription
settingsObject | 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:

NameTypeDefaultDescription
typestring | anychart.enums.EventMarkerType
'circle'
Marker type to set.

Returns:

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

useHtml

Getter for the useHTML flag.

Returns:

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

Params:

NameTypeDescription
enabledbooleanEnabled state 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:

NameTypeDescription
alignstring | anychart.graphics.vector.Text.VAlignVertical align 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:

NameTypeDescription
widthstring | numberMarkers width.

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:

NameTypeDefaultDescription
modeanychart.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:

NameTypeDefaultDescription
modeanychart.enums.WordWrap | string
'normal'
Value to set.

Returns:

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

zIndex

Getter for the Z-index of the element.

Returns:

number - Z-index.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
zIndexnumber
0
Value to set.

Returns:

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