AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated v7 version of this document. Switch to the v8 version to see the up to date information.

class anychart.core.axisMarkers.GanttText Improve this Doc

Extends: anychart.core.Text

Gantt text marker.

Methods Overview

Specific settings
scale()Scale settings.
text()Text settings.
value()Text marker value settings.
Advanced Text Settings
fontVariant()Font variant settings.
letterSpacing()Text letter spacing settings.
textDirection()Text direction settings.
textIndent()Text indent settings.
textOverflow()Text overflow settings.
textWrap()Text wrap settings.
useHtml()Text useHtml settings.
Base Text Settings
fontColor()Font color settings.
fontDecoration()Font decoration settings.
fontFamily()Font family settings.
fontOpacity()Font opacity settings.
fontSize()Font size settings.
fontStyle()Font style settings.
fontWeight()Font weight settings.
hAlign()Text horizontal align settings.
lineHeight()Text line height settings.
vAlign()Text vertical align settings.
Events
disablePointerEvents()Pointer events settings.
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.
Export
print()Prints all elements.
Interactivity
enabled()Element state (enabled or disabled).
selectable()Text selectable option.
Size and Position
align()Align settings.
anchor()Anchor settings.
height()Text marker height.
isHorizontal()Whether a text marker has horizontal layout.
layout()Layout settings.
offsetX()Text marker offset by x.
offsetY()Text marker offset by y.
rotation()Rotation settings.
width()Text marker width.
zIndex()Z-index of the element.
Text Settings
textSettings()Text settings.

Methods Description

align

Getter for the gantt text marker align.

Returns:

anychart.enums.Align | string - The gantt text marker align.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var align = customTextMarker.align();
Setter for the gantt text marker align.

Params:

NameTypeDefaultDescription
valueanychart.enums.Align | string
"center"
Text marker align.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

anchor

Getter for the text marker anchor settings.

Returns:

anychart.enums.Anchor | string - Text marker anchor settings.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var anchor = customTextMarker.anchor();
Setter for the text marker anchor settings.

Params:

NameTypeDefaultDescription
valueanychart.enums.Anchor | string
"center"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

disablePointerEvents

Getter for the current pointer events.

Returns:

boolean - Flag of the current state.
Setter for the pointer events.

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

enabled

Getter for the current element state (enabled or disabled).

Returns:

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

Params:

NameTypeDefaultDescription
valueboolean
true
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.
Example.
if (!element.enabled())
   element.enabled(true);

fontColor

Getter for the text font color.

Returns:

string - The current font color.
Setter for the text font color.
https://www.w3schools.com/html/html_colors.asp

Params:

NameTypeDefaultDescription
valuestring
"#7c868e"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

fontDecoration

Getter for the text font decoration.

Returns:

anychart.graphics.vector.Text.Decoration | string - The current font decoration.
Setter for the text font decoration.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.Decoration | string
"none"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

fontFamily

Getter for the current font family.

Returns:

string - The current font family.
Setter for font family.

Params:

NameTypeDefaultDescription
valuestring
"Verdana", Helvetica, Arial, sans-serif
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

fontOpacity

Getter for the text font opacity.

Returns:

number - The current font opacity.
Setter for the text font opacity. Double value from 0 to 1.

Params:

NameTypeDefaultDescription
valuenumber
1
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

fontSize

Getter for the current text font size.

Returns:

string | number - Current font size.
Setter for text font size.

Params:

NameTypeDefaultDescription
valuestring | number
16
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

fontStyle

Getter for the text font style.

Returns:

anychart.graphics.vector.Text.FontStyle | string - The current font style.
Setter for the text font style.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.FontStyle | string
"normal"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

fontVariant

Getter for the text font variant.

Returns:

anychart.graphics.vector.Text.FontVariant | string - The current font variant.
Setter for the text font variant.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.FontVariant | string
"normal"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

fontWeight

Getter for the text font weight.

Returns:

string | number - The current font weight.

Params:

NameTypeDefaultDescription
valuestring | number
"normal"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

hAlign

Getter for the text horizontal align.

Returns:

anychart.graphics.vector.Text.HAlign | string - The current text horizontal align.
Setter for the text horizontal align.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.HAlign | string
"start"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

height

Getter for the text marker height.

Returns:

number | string | null - The text marker height.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var height = customTextMarker.height();
Setter for the text marker height.

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

isHorizontal

Whether a text marker has horizontal layout.
Note: Any type of Gantt diagram will return "false", because markers in Gantt charts can be only vertical.
Layout is defined by anychart.core.axisMarkers.GanttLine#layout method.

Returns:

boolean - Returns false, because markers in Gantt charts can be only vertical.

layout

Getter for the gantt text marker layout.

Returns:

anychart.enums.Layout | string - Vertical layout.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var layoutSettings = customTextMarker.layout();
Setter for the text marker layout.
Note: The layout method will not work here, only "vertical" layout are available in Gantt Chart.

Params:

NameTypeDefaultDescription
valueanychart.enums.Layout | string
"vertical"
Text marker layout.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

letterSpacing

Getter for the text letter spacing.

Returns:

string | number - The current letter spacing.

Params:

NameTypeDefaultDescription
valuestring | number
"normal"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

lineHeight

Getter for the text line height.

Returns:

string | number - The current text line height.

Params:

NameTypeDefaultDescription
valuestring | number
"normal"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

listen

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
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 }.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

listenOnce

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

offsetX

Getter for the text marker offset by x.

Returns:

number | string - The text marker offset by x.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var offsetX = customTextMarker.offsetX();
Setter for the text marker offset by x.

Params:

NameTypeDefaultDescription
valuenumber | string
0
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

offsetY

Getter for the text marker offset by y.

Returns:

number | string - The text marker offset by y.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var offsetY = customTextMarker.offsetY();
Setter for the text marker offset by y.

Params:

NameTypeDefaultDescription
valuenumber | string
0
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

print

Prints all elements on related stage.

Params:

NameTypeDefaultDescription
paperSizeOrOptionsanychart.graphics.vector.PaperSize | Object
Paper size or object with options.
landscapeboolean
false
Flag of landscape.

removeAllListeners

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

Params:

NameTypeDescription
typestringType of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

rotation

Getter for the gantt text marker rotation in degrees.

Returns:

null | number - The gantt text marker rotation.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var rotation = customTextMarker.rotation();
Setter for the gantt text marker rotation.

Params:

NameTypeDefaultDescription
valuenumber
null
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

scale

Getter for the gantt text marker scale.

Returns:

anychart.scales.GanttDateTime - The gantt text marker scale.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var scaleSettings = customTextMarker.scale();
Getter for the gantt text marker scale.
Note: The scale method will not work here, only "dateTime" scale are available in Gantt Chart. Learn more about scale.

Params:

NameTypeDescription
valueanychart.scales.GanttDateTimeScale.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

selectable

Getter for the text selectable option.

Returns:

boolean - The current text selectable option.
Setter for the text selectable.

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

text

Getter for the gantt text marker text setting.

Returns:

string - The gantt text setting.
Setter for the gantt text marker text setting.

Params:

NameTypeDescription
valuestringValue to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

textDirection

Getter for the text direction.

Returns:

anychart.graphics.vector.Text.Direction | string - Current text direction.
Setter for the text direction.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.Direction | string
"ltr"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

textIndent

Getter for the text indent.

Returns:

number - The current text indent.
Setter for the text indent.

Params:

NameTypeDefaultDescription
valuenumber
0
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

textOverflow

Getter for the text overflow settings.

Returns:

anychart.graphics.vector.Text.TextOverflow | string - The current text overflow settings.
Setter for the text overflow settings.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.TextOverflow | string
""
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

textSettings

Getter for the full text appearance settings.

Returns:

Object - A copy of settings object.
Getter for all text appearance settings.

Params:

NameTypeDescription
namestringSetting name.

Returns:

string | number | boolean | undefined - Value of the setting.
Setter for text appearance settings.

Params:

NameTypeDescription
objectWithSettingsObjectSettings object. Complete object looks like this: { "fontSize": smth, "fontFamily": smth, "fontColor": smth, "fontOpacity": smth, "fontDecoration": smth, "fontStyle": smth, "fontVariant": smth, "fontWeight": smth, "letterSpacing": smth, "textDirection": smth, "lineHeight": smth, "textIndent": smth, "vAlign": smth, "hAlign": smth, "textWrap": smth, "textOverflow": smth, "selectable": smth, "useHtml": smth }.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.
Setter for the text appearance settings.

Params:

NameTypeDescription
namestringSetting name.
valuestring | number | boolean | functionSettings value.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

textWrap

Getter for the text wrap settings.

Returns:

anychart.graphics.vector.Text.TextWrap | string - The current text wrap settings.
Setter for the text wrap settings.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.TextWrap | string
"byLetter"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

unlisten

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

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

unlistenByKey

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

Params:

NameTypeDescription
keyObjectThe key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

useHtml

Getter for the useHTML flag.

Returns:

boolean - The current value of useHTML flag.
Setter for flag useHTML.

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

vAlign

Getter for the text vertical align.

Returns:

anychart.graphics.vector.Text.VAlign | string - The current text vertical align.
Setter for the text vertical align.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.VAlign | string
"top"
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

value

Getter for the gantt text marker value.

Returns:

number | anychart.enums.GanttDateTimeMarkers | string - The gantt text marker value.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
var value = customTextMarker.value();
Setter for the gantt text marker value.

Params:

NameTypeDescription
valuenumber | anychart.enums.GanttDateTimeMarkers | stringText marker value settings.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

width

Getter for the text marker width.

Returns:

number | string | null - The text marker width.
See listing
var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value("2000-02-27 00:00:00");
var width = customTextMarker.width();
Setter for the text marker width.

Params:

NameTypeDefaultDescription
valuenumber | string | null
null
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.

zIndex

Getter for the current Z-index of the element.

Returns:

number - The current zIndex.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
valuenumber
0
Value to set.

Returns:

anychart.core.axisMarkers.GanttText - Self instance for method chaining.