AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.resource.resourceList.TextSettings Improve this Doc

Extends: anychart.core.resource.resourceList.SettingsWithMargin

Class representing text settings for resource list items.

Methods Overview

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.
fontVariant()Font variant settings.
fontWeight()Font weight settings.
hAlign()Font horizontal align settings.
letterSpacing()Letter spacing settings.
lineHeight()Line height settings.
selectable()Text selectable settings.
textDirection()Text direction settings.
textIndent()Text indent settings.
textOverflow()Text overflow settings.
textShadow()Text shadow settings.
useHtml()Text useHtml settings.
vAlign()Font vertical align settings.
wordBreak()Word break mode.
wordWrap()Word-wrap mode.
Content Text Settings
disablePointerEvents()Pointer events settings.
Size and Position
margin()Margin settings.

Methods Description

disablePointerEvents

Getter for the pointer events settings.

Returns:

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

Params:

NameTypeDefaultDescription
enabledboolean
false
Value to set.

Returns:

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

fontColor

Getter for the font color.

Returns:

string - Text font color.
See listing
var names = resourceList.names();
var color = names.fontColor();
Setter for the font color.

Params:

NameTypeDefaultDescription
colorstring
'#000'
Font color.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

fontDecoration

Getter for the text font decoration.

Returns:

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

Params:

NameTypeDefaultDescription
typeanychart.graphics.vector.Text.Decoration | string
'none'
Font decoration.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

fontFamily

Getter for the font family.

Returns:

string - Text font family.
See listing
var names = resourceList.names();
var font = names.fontFamily();
Setter for the font family.

Params:

NameTypeDefaultDescription
fontFamilystring
'Helvetica Neue','Helvetica',sans-serif
Font family.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

fontOpacity

Getter for the font opacity.

Returns:

number - Text font opacity.
See listing
var names = resourceList.names();
var opacity = names.fontOpacity();
Setter for the font opacity.

Params:

NameTypeDefaultDescription
opacitynumber
1
Font opacity.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

fontSize

Getter for the text font size.

Returns:

string | number - Text font size.
See listing
var names = resourceList.names();
var size = names.fontSize();
Setter for the text font size text.

Params:

NameTypeDefaultDescription
sizestring | number
17
Font size.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

fontStyle

Getter for the font style.

Returns:

anychart.graphics.vector.Text.FontStyle | string - Text font style.
See listing
var names = resourceList.names();
var style = names.fontStyle();
Setter for the font style.

Params:

NameTypeDefaultDescription
styleanychart.graphics.vector.Text.FontStyle | string
'normal'
Font style.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

fontVariant

Getter for the font variant.

Returns:

anychart.graphics.vector.Text.FontVariant | string - The font variant.
See listing
var names = resourceList.names();
var variant = names.fontVariant();
Setter for the font variant.

Params:

NameTypeDefaultDescription
typeanychart.graphics.vector.Text.FontVariant | string
'normal'
Font variant.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

fontWeight

Getter for the font weight.

Returns:

string | number - The font weight.
See listing
var names = resourceList.names();
var weight = names.fontWeight();
Setter for the font weight.

Params:

NameTypeDefaultDescription
weightstring | number
'bold'
Font weight.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

hAlign

Getter for the font horizontal align.

Returns:

anychart.graphics.vector.Text.HAlign | string - Font horizontal align.
See listing
var names = resourceList.names();
var hAlign = names.hAlign();
Setter for the font horizontal align.

Params:

NameTypeDefaultDescription
alignanychart.graphics.vector.Text.HAlign | string
'start'
Value to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

letterSpacing

Getter for the letter spacing.

Returns:

string | number - The letter spacing.
See listing
var names = resourceList.names();
var letterSpacing = names.letterSpacing();
Setter for the letter spacing.

Params:

NameTypeDefaultDescription
spacingstring | number
'normal'
Value to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

lineHeight

Getter for the font line height.

Returns:

string | number - Line height.
See listing
var names = resourceList.names();
var lineHeight = names.lineHeight();
Setter for the font line height.

Params:

NameTypeDefaultDescription
heightstring | number
'normal'
Line height to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

margin

Getter for the margin.

Returns:

anychart.core.utils.Margin - The margin.
Setter for the margin using a single value.

Params:

NameTypeDescription
marginArray.<(number|string)> | ObjectMargin to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.
Setter for the callout margin using several values.

Params:

NameTypeDescription
value1string | numberTop or top-bottom space.
value2string | numberRight or right-left space.
value3string | numberBottom space.
value4string | numberLeft space.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

selectable

Getter for the text selectable.

Returns:

boolean - The text selectable option.
See listing
var names = resourceList.names();
var selectable = names.selectable();
Setter for the text selectable.

Params:

NameTypeDefaultDescription
enabledboolean
false
Enabled state to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

textDirection

Getter for the text direction.

Returns:

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

Params:

NameTypeDefaultDescription
typeanychart.graphics.vector.Text.Direction | string
'ltr'
Value to set

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

textIndent

Getter for text indent settings.

Returns:

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

Params:

NameTypeDefaultDescription
indentnumber
0
Text indent to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

textOverflow

Getter for text overflow settings.

Returns:

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

Params:

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

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

textShadow

Getter for the text shadow.

Returns:

string - String representation of text shadow.
See listing
var names = resourceList.names();
var color = names.textShadow();
Setter for the text shadow.

Params:

NameTypeDefaultDescription
textShadowanychart.graphics.vector.TextShadow | string
'none'
Text shadow to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

useHtml

Getter for the useHTML flag.

Returns:

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

Params:

NameTypeDefaultDescription
enabledboolean
false
Value to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

vAlign

Getter for the font vertical align.

Returns:

anychart.graphics.vector.Text.VAlign | string - Font vertical align.
See listing
var names = resourceList.names();
var vAlign = names.vAlign();
Setter for the font vertical align.

Params:

NameTypeDefaultDescription
alignanychart.graphics.vector.Text.VAlign | string
'top'
Value to set.

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.

wordBreak

Getter for the word-break mode.

Returns:

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

Params:

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

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.
See listing
var resourceList = chart.resourceList();
var names = resourceList.names();
var wordBreak = names.wordBreak();

wordWrap

Getter for the word-wrap mode.

Returns:

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

Params:

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

Returns:

anychart.core.resource.resourceList.TextSettings - Self instance for method chaining.
See listing
var resourceList = chart.resourceList();
var names = resourceList.names();
names.wordWrap("break-word");