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.

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

When implementing a callback function for this property, use the scale value to be displayed in a label. These values can be accessed using the following properties of the this object:

  • value
    Specifies the scale value represented by a label.
  • valueText
    Specifies the scale value with an applied format, if the format and precision (optional) properties are specified.

The function's parameter represents the same object as the this object. If appropriate, you can use the function's parameter to obtain the scale value that is currently represented. 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: String
Default Value: ''
Accepted Values: 'currency' | 'fixedPoint' | 'percent' | 'decimal' | 'exponential' | 'largeNumber' | 'thousands' | 'millions' | 'billions' | 'trillions' | 'longDate' | 'longTime' | 'monthAndDay' | 'monthAndYear' | 'quarterAndYear' | 'shortDate' | 'shortTime' | 'millisecond' | 'day' | 'month' | 'quarter' | 'year'

Labels display scale values. You can apply formatting to the label text by using one of the available formats.

NOTE: You can set a precision for label text when the 'fixedPoint', 'exponential', 'currency' or 'percent' format is applied. Use the precision property to do this.

For details on formatting provided, refer to the Data Formatting topic.

Show Example:
jQuery

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


                                    

                                    

precision

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

Type: Number

This property's value must be an integer indicating the number of digits to show in the scale values displayed in labels. This property value is used when labels display scale values in one of the following numeric formats: 'fixedPoint', 'exponential', 'currency' or 'percent'. To learn how to set a format for scale values, refer to the format property description.

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

Show Example:
jQuery

In this example, the scale labels are formatted in a 'percent' format. The precision of the scale values is set to 1 using the precision option.


                                    

                                    

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
Accepted Values: true|false

Show Example:
jQuery

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