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

class anychart.core.ui.LabelsFactory 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 labels anchor settings.
background()Getter for the current labels background settings.
enabled()Getter for the current element state.
height()Getter for the current labels height settings.
maxFontSize()Getter for the current maximum font size setting for adjust text to.
minFontSize()Getter for the current minimum font size setting for adjust text from.
offsetX()Getter for the current labels offsetX settings.
offsetY()Getter for the current labels offsetY settings.
padding()Getter for labels padding setting.
position()Getter for the current labels position settings.
positionFormatter()Getter for the current labels position formatter function.
rotation()Getter for the current rotation angle around an anchor.
textFormatter()Getter for the current labels text formatter function.
width()Getter for the current labels width settings.

Methods Description

adjustFontSize

Getter for the current adjust font size.

Returns:

Object - The current adjust font size 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 - 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 - Self instance for method chaining.

Try it:

anchor

Getter for the current labels anchor settings.

Returns:

anychart.enums.Anchor - The current labels anchor setting.

Try it:

Setter for the labels anchor settings.

Params:

Name Type Default Description
value anychart.enums.Anchor | string
'center'
Labels anchor settings.

Returns:

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

Try it:

background

Getter for the current labels background settings.

Returns:

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

Try it:

Setter for the labels background settings.

Params:

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

Returns:

anychart.core.ui.LabelsFactory - 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 - Self instance for method chaining.

Try it:

height

Getter for the current labels height settings.

Returns:

number string null - The current labels height.

Try it:

Setter for the labels height settings.

Params:

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

Returns:

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

Try it:

maxFontSize

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

Returns:

number - The current maximum font size setting.

Try it:

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

Params:

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

Returns:

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

Try it:

minFontSize

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

Returns:

number - The current minimum font size setting.

Try it:

Setter for the minimum font size setting for adjust text from.

Params:

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

Returns:

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

Try it:

offsetX

Getter for the current labels offsetX settings.

Returns:

number string - The current labels offsetX value.

Try it:

Setter for the labels offsetX settings.

Params:

Name Type Description
value number | string Labels offsetX settings to set.

Returns:

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

Try it:

offsetY

Getter for the current labels offsetY settings.

Returns:

number string - The current labels offsetY value.

Try it:

Setter for the labels offsetY settings.

Params:

Name Type Description
value number | string Labels offsetY settings to set.

Returns:

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

Try it:

padding

Getter for labels padding setting.

Returns:

anychart.core.utils.Padding - The current labels padding.
Setter for labels 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 - Self instance for method chaining.

Try it:

Setter for labels padding setting in pixels using 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 - Self instance for method chaining.

Try it:

position

Getter for the current labels position settings.

Returns:

string - The current labels position settings.

Try it:

Setter for the labels position settings.

Params:

Name Type Default Description
value string
'centerTop'
Labels position settings.

Returns:

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

Try it:

positionFormatter

Getter for the current labels position formatter function.

Returns:

function - The current labels position formatter function.
Setter for the labels position formatter function.

Params:

Name Type Description
value function Labels position formatter function.

Returns:

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

Try it:

rotation

Getter for the current rotation angle around an anchor.

Returns:

number - The current rotation angle in degrees.

Try it:

Setter for the rotation angle around an anchor.

Params:

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

Returns:

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

Try it:

textFormatter

Getter for the current labels text formatter function.

Returns:

function - Labels text formatter function.
Setter for the labels text formatter function.

Params:

Name Type Description
value function Labels text formatter function.

Returns:

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

Try it:

width

Getter for the current labels width settings.

Returns:

number string null - The current labels width settings

Try it:

Setter for the labels width settings.

Params:

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

Returns:

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

Try it: