Top
You are looking at an outdated 7.5.1 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.core.ui.LabelsFactory.Label Improve this Doc

Extends: anychart.core.Text

Class for creation of sets of similar labels and management of such sets. Any individual label can be changed after all labels are displayed.

Methods Overview

Miscellaneous
adjustFontSize()Getter for the current adjust font size.
anchor()Getter for the current label anchor settings.
background()Getter for the current label background settings.
enabled()Getter for the current element state.
getIndex()Returns label index.
height()Getter for the current label height.
maxFontSize()Gets the current maximum font size setting for adjust text to.
minFontSize()Gets the current minimum font size setting for adjust text from.
offsetX()Getter for the current label offsetX settings.
offsetY()Getter for the current label offsetY settings.
padding()Getter for current label padding.
position()Getter for the current label position settings.
positionFormatter()Gets the current position formatter.
rotation()Getter for the current rotate a label around an anchor.
textFormatter()Gets the current text formatter.
width()Getter for the current label width.

Methods Description

adjustFontSize

Getter for the current adjust font size.

Returns:

Object - The current adjustFontSize settings.

Try it:

Setter for the adjusting font size by two parameters width and height.

Params:

Name Type Default Description
adjustByWidth boolean
false
Enables adjusting by width. Is font needs to be adjusted by width.
adjustByHeight boolean
false
Enables adjusting by height. Is font needs to be adjusted by height.

Returns:

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

Try it:

Setter for the adjusting font size by one parameter.

Params:

Name Type Default Description
value boolean | Array.<boolean, boolean> | Object
false
Enables adjusting by width and height. Adjusting flag, object or array.

Returns:

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

Try it:

anchor

Getter for the current label anchor settings.

Returns:

anychart.enums.Anchor - The current label anchor settings.

Try it:

Setter for the label anchor settings.

Params:

Name Type Default Description
value anychart.enums.Anchor | string
'center'
Value to set.

Returns:

anychart.enums.Anchor - Self instance for method chaining.

Try it:

background

Getter for the current label background settings.

Returns:

anychart.core.ui.Background - The current background.

Try it:

Setter for the current label background settings.

Params:

Name Type Description
value string | Object | null | boolean Background settings to set.

Returns:

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

enabled

Getter for the current element state.

Returns:

boolean - The current element state.

Try it:

Setter for the element enabled state.

Params:

Name Type Default Description
value null | boolean
false
Value to set.

Returns:

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

Try it:

getIndex

Returns label index.

Returns:

number - The current label index.

Try it:

height

Getter for the current label height.

Returns:

number string null - The current label height.

Try it:

Setter for the label height.

Params:

Name Type Description
value number | string | null Height to set.

Returns:

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

Try it:

maxFontSize

Gets the current maximum font size setting for adjust text to.

Returns:

number - The current maximum font size setting.

Try it:

Sets the maximum font size setting for adjust text to.

Params:

Name Type Description
value number | string Maximum font size to set.

Returns:

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

Try it:

minFontSize

Gets the current minimum font size setting for adjust text from.

Returns:

number - The current font size setting.

Try it:

Sets the minimum font size setting for adjust text from.

Params:

Name Type Description
value number | string Minimum font size to set.

Returns:

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

Try it:

offsetX

Getter for the current label offsetX settings.

Returns:

number string - The current label offsetX settings.

Try it:

Setter for the label offsetX settings.

Params:

Name Type Description
value number | string Value to set.

Returns:

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

Try it:

offsetY

Getter for the current label offsetY settings.

Returns:

number string - The current label offsetY settings.

Try it:

Setter for the label offsetY settings.

Params:

Name Type Description
value number | string Value to set.

Returns:

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

Try it:

padding

Getter for current label padding.

Returns:

anychart.core.utils.Padding - The current label padding.
Setter for label padding in pixels using a single value.

Params:

Name Type Description
value Array.<(number|string)> | Object | number | string Space value, object or array.

Returns:

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

Try it:

Setter for label padding setting in pixels using a several value.

Params:

Name Type Description
value1 string | number Top or top-bottom space.
value2 string | number Right or right-left space.
value3 string | number Bottom space.
value4 string | number Left space.

Returns:

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

Try it:

position

Getter for the current label position settings.

Returns:

string - The current label position settings.

Try it:

Setter for the current label position settings.

Params:

Name Type Description
value string Value to set.

Returns:

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

Try it:

positionFormatter

Gets the current position formatter.

Returns:

* - The current position formatter.
Sets the position formatter.

Params:

Name Type Description
value * Position formatter.

Returns:

* - Self instance for method chaining.

Try it:

rotation

Getter for the current rotate a label around an anchor.

Returns:

number - The current rotation angle in degrees.

Try it:

Setter for the rotate a label around an anchor.

Params:

Name Type Default Description
value number
0
Rotation angle in degrees.

Returns:

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

Try it:

textFormatter

Gets the current text formatter.

Returns:

* - The current text formatter.
Sets the text formatter.

Params:

Name Type Description
value * Text formatter.

Returns:

* - Self instance for method chaining.

Try it:

width

Getter for the current label width.

Returns:

number string null - The current label width.

Try it:

Setter for the label width.

Params:

Name Type Description
value number | string | null Width to set.

Returns:

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

Try it: