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.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.
textWrap()Text wrap settings.
useHtml()Text useHtml settings.
vAlign()Font vertical align settings.
Size and Position
margin()Margin settings.

Methods Description

fontColor

Getter for the font color.

Returns:

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

Params:

NameTypeDefaultDescription
valuestring
"#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 currentNames = currentResourceList.names();
var decoration = currentNames.fontDecoration();
Setter for the text font decoration.

Params:

NameTypeDefaultDescription
valueanychart.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 currentNames = currentResourceList.names();
var font = currentNames.fontFamily();
Setter for the font family.

Params:

NameTypeDefaultDescription
valuestring
"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 currentNames = currentResourceList.names();
var opacity = currentNames.fontOpacity();
Setter for the font opacity.

Params:

NameTypeDefaultDescription
valuenumber
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 currentNames = currentResourceList.names();
var size = currentNames.fontSize();
Setter for the text font size text.

Params:

NameTypeDefaultDescription
valuestring | 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 currentNames = currentResourceList.names();
var style = currentNames.fontStyle();
Setter for the font style.

Params:

NameTypeDefaultDescription
valueanychart.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 currentNames = currentResourceList.names();
var variant = currentNames.fontVariant();
Setter for the font variant.

Params:

NameTypeDefaultDescription
valueanychart.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 currentNames = currentResourceList.names();
var weight = currentNames.fontWeight();
Setter for the font weight.

Params:

NameTypeDefaultDescription
valuestring | 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 currentNames = currentResourceList.names();
var currentHAlign = currentNames.hAlign();
Setter for the font horizontal align.

Params:

NameTypeDefaultDescription
valueanychart.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 currentNames = currentResourceList.names();
var currentLetterSpacing = currentNames.letterSpacing();
Setter for the letter spacing.

Params:

NameTypeDefaultDescription
valuestring | 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 currentNames = currentResourceList.names();
var currentLineHeight = currentNames.lineHeight();
Setter for the font line height.

Params:

NameTypeDefaultDescription
valuestring | number
"normal"
Value 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
valueArray.<(number|string)> | ObjectValue 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 currentNames = currentResourceList.names();
var currentSelectable = currentNames.selectable();
Setter for the text selectable.

Params:

NameTypeDefaultDescription
valueboolean
false
Value 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 currentNames = currentResourceList.names();
var direction = currentNames.textDirection();
Setter for the text direction.

Params:

NameTypeDefaultDescription
valueanychart.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 currentNames = currentResourceList.names();
var currentTextIndent = currentNames.textIndent();
Setter for text indent settings.

Params:

NameTypeDefaultDescription
valuenumber
0
Value 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 currentNames = currentResourceList.names();
var currentTextOverflow = currentNames.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.

textWrap

Getter for the text wrap.

Returns:

anychart.graphics.vector.Text.TextWrap | string - Text wrap settings.
See listing
var currentNames = currentResourceList.names();
var currentTextWrap = currentNames.textWrap();
Setter for the text wrap.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Text.TextWrap | string
"noWrap"
Value 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 currentNames = currentResourceList.names();
var useHtmlFlag = currentNames.useHtml();
Setter for the useHTML flag.

Params:

NameTypeDefaultDescription
valueboolean
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 currentNames = currentResourceList.names();
var currentVAlign = currentNames.vAlign();
Setter for the font vertical align.

Params:

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

Returns:

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