label

Specifies common options for scale labels.

Type: Object

Scale labels represent textual values for major scale ticks. The label object exposes properties that allow you to specify custom text for scale labels and properties that allow you to change the font for text.

View Demo

Show Example:
jQuery

In this example, the scale labels are formatted as 'currency' using the format option and indented from the scale by 3 pixels using the topIndent option.


                                    

                                    

customizeText

Specifies a callback function that returns the text to be displayed in scale labels.

Type: function(scaleValue)
Function parameters:
scaleValue: Object
Defines a scale value.
Object structure:
value: Date|Number
Specifies the scale value represented by a label.
valueText: String
Specifies the scale value with applied formatting.
Return Value: String
The text to be displayed by a scale label.
Cannot be used in themes.

When implementing a callback function for this property, use the scale value to be displayed in a label. This value can be accessed using the fields of the object that is passed as the function's parameter. Alternatively, you can use the this object within the function. This object has the same structure as the object passed as a parameter.

For general information on data formatting, refer to the Data Formatting topic.

Show Example:
jQuery

In this example, the scale label text is customized using the customizeText option.


                                    

                                    

font

Specifies font options for the text displayed in the range selector's scale labels.

Type: Object

Show Example:
jQuery

In this example, the scale label's font options are changed.


                                    

                                    

format

Specifies a format for the text displayed in scale labels.

Type: Format
Default Value: undefined

NOTE: DevExtreme widgets provide a wide choice of predefined formats. If you are, however, going to use custom formats, link the Globalize library to your project. Learn how to do this from topics in the Installation section.

See Also
  • format - provides a comprehensive overview of formatting capabilities.
  • Data Formatting - shows how to apply formatting to various widget elements.
Show Example:
jQuery

In this example, the scale labels are formatted as 'currency' using the format option.


                                    

                                    

precision

Deprecated

Use the scale | label | format | precision option instead.

Specifies a precision for the formatted value displayed in the scale labels.

Type: Number
Default Value: undefined

topIndent

Specifies a spacing between scale labels and the background bottom edge.

Type: Number
Default Value: 7

RangeSelectorScaleLabelTopIndent ChartJS

visible

Specifies whether or not the scale's labels are visible.

Type: Boolean
Default Value: true

Show Example:
jQuery

Use the check box below to change the visibility of the scale.