AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.gantt.TimeLineHeader.LevelWrapper Improve this Doc

Extends: anychart.core.Base

Single timeline header level.

Methods Overview

Specific settings
format()Function to format content text.
Coloring
fill()Fill settings
stroke()Stroke settings
Content Text Settings
adjustFontSize()Adjusting settings.
disablePointerEvents()Pointer events 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.
fontVariant()Font variant settings.
fontWeight()Font weight settings.
hAlign()Text horizontal align settings.
letterSpacing()Text letter spacing settings.
lineHeight()Line height settings.
maxFontSize()Maximum font size setting.
minFontSize()Minimum font size settings.
textDirection()Text direction settings.
textIndent()Text indent settings.
textOverflow()Text overflow settings.
useHtml()Text useHtml settings.
vAlign()Text vertical align settings.
wordBreak()Word break mode.
wordWrap()Word-wrap mode.
Interactivity
enabled()Level state (enabled or disabled).
selectable()Text selectable option.

Methods Description

adjustFontSize

Getter for the adjust font settings.

Returns:

Object - AdjustFontSize settings.
Setter for the adjust font settings.

Params:

NameTypeDefaultDescription
bothOrByWidthObject | Array.<boolean> | boolean
{width: false, height: false}
If only one param is set, its value goes for another too (see source code).
byHeightboolean
Is font needs to be adjusted by height.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
Example
label.adjustFontSize(false);
// the same
label.adjustFontSize(false, false);
// the same
label.adjustFontSize([false, false]);

disablePointerEvents

Getter for the pointer events settings.

Returns:

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

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
See listing
var level = header.level(0);
level.disablePointerEvents(true);

enabled

Getter for the level state.

Returns:

boolean - Level state.
See listing
var level = header.level(1);
var state = level.enabled();
Setter for the level enabled state.

Params:

NameTypeDefaultDescription
statenull | boolean
true
Value to set.

Returns:

anychart.core.ui.LabelsFactory - Self instance for method chaining.

fill

Getter for the level fill.

Returns:

anychart.graphics.vector.Fill | string - The level fill.
See listing
var fill = level.fill();
Setter for fill settings using an array, an object or a string. Learn more about coloring.

Params:

NameTypeDescription
coloranychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)>Color as an object, an array or a string.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
Fill color with opacity.

Params:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - 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.gantt.TimeLineHeader.LevelWrapper - 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.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontColor

Getter for font color settings.

Returns:

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

Params:

NameTypeDescription
colorstringValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontDecoration

Getter for the text font decoration.

Returns:

anychart.graphics.vector.Text.Decoration | string - Font decoration.
See listing
var fontDecoration = level.fontDecoration();
Setter for the text font decoration.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.Decoration | string
anychart.graphics.vector.Text.Decoration#NONE
Value to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontFamily

Getter for the font family.

Returns:

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

Params:

NameTypeDescription
familystringValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontOpacity

Getter for the text font opacity.

Returns:

number - Font opacity.
See listing
var fontOpacity = level.fontOpacity();
Setter for the text font opacity.
Double value from 0 to 1.

Params:

NameTypeDescription
opacitynumberValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontSize

Getter for font size settings.

Returns:

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

Params:

NameTypeDescription
sizenumber | stringValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontStyle

Getter for font style settings.

Returns:

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

Params:

NameTypeDescription
valuestring | anychart.graphics.vector.Text.FontStyleValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontVariant

Getter for font variant settings.

Returns:

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

Params:

NameTypeDescription
valuestring | anychart.graphics.vector.Text.FontVariantValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

fontWeight

Getter for font weight settings.

Returns:

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

Params:

NameTypeDescription
weightstring | numberValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

format

Getter for the function content text.

Returns:

function | string - Token or function to format text.
See listing
var level = timeLine.level();
var format = level.format();
Setter for the function content text.
Learn more about using the format() method.

Params:

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

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

hAlign

Getter for text horizontal align settings.

Returns:

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

Params:

NameTypeDescription
valuestring | anychart.graphics.vector.Text.HAlignValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

letterSpacing

Getter for letter spacing settings.

Returns:

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

Params:

NameTypeDescription
valuenumberValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

lineHeight

Getter for the text line height.

Returns:

string | number - Text line height.
See listing
var lineHeight = level.lineHeight();

Params:

NameTypeDescription
valuestring | numberValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

maxFontSize

Getter for the font size for adjust text to.

Returns:

number - Maximum font size.
Setter for the font size for adjust text to.

Params:

NameTypeDescription
valuenumber | stringValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

minFontSize

Getter for minimum font size settings for adjust text from.

Returns:

number - Minimum font size.
Setter for minimum font size settings for adjust text from.

Params:

NameTypeDefaultDescription
minFontSizenumber | string
0
Value to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

selectable

Getter for the text selectable option.

Returns:

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

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

stroke

Getter for the level stroke.

Returns:

anychart.graphics.vector.Stroke | string - The connector preview stroke.
See listing
var stroke = level.stroke();
Setter for the level stroke.

Params:

NameTypeDefaultDescription
settingsanychart.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 joint style.
lineCapstring | anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
Setter for the level stroke using an object.

Params:

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

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

textDirection

Getter for the text direction.

Returns:

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

Params:

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

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

textIndent

Getter for the text indent.

Returns:

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

Params:

NameTypeDescription
valuenumberValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

textOverflow

Getter for the text overflow settings.

Returns:

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

Params:

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

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
See listing.
var level = header.level(0);
level.textOverflow("...");

useHtml

Getter for the useHTML flag.

Returns:

boolean - Value of useHTML flag.
See listing
var useHtml = level.useHtml();
Setter for the useHTML flag.

Params:

NameTypeDefaultDescription
valueboolean
false
Value to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
See listing.
var level = header.level(0);
level.useHtml(true);

vAlign

Getter for the text vertical align.

Returns:

anychart.graphics.vector.Text.VAlign | string - Text vertical align.
See listing
var vAlign = level.vAlign();
Setter for the text vertical align.

Params:

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

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.

wordBreak

Getter for the word-break mode.

Returns:

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

Params:

NameTypeDescription
valueanychart.enums.WordBreak | stringValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
See listing.
var level = header.level(0);
level.wordBreak("break-all");

wordWrap

Getter for the word-wrap mode.

Returns:

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

Params:

NameTypeDescription
valueanychart.enums.WordWrap | stringValue to set.

Returns:

anychart.core.gantt.TimeLineHeader.LevelWrapper - Self instance for method chaining.
See listing.
var level = header.level(0);
level.wordWrap("break-all");