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 to change the text font.

Show Example:
jQuery

In this example, the text of the scale labels is customized using the customizeText option. In addition, the color and size options of the scale label text are changed.


                                    

                                    

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: Number

Specifies the scale value represented by a label.

valueText: String

Specifies the value with applied formatting if the format option is set.

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.

View Demo

Show Example:
jQuery

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


                                    

                                    

font

Specifies font options for the text displayed in the scale labels of the gauge.

Type: Object

Show Example:
jQuery

In this example, font options of the scale labels are changed.


                                    

                                    

format

Specifies a format for the text displayed in scale labels.

Type: Format
Default Value: undefined
See Also
  • format - provides a comprehensive overview of formatting capabilities. Note that only numeric subset of the predefined formats can be used.
  • Data Formatting - shows how to apply formatting to various widget elements.
Show Example:
jQuery

In this example, the text of the scale labels is displayed in a percent format.


                                    

                                    

hideFirstOrLast

Specifies which label to hide in case of overlapping.

Type: String
Default Value: 'last'
Accepted Values: 'last' | 'first'

When using the widget as an ASP.NET MVC Control, specify this option using the GaugeOverlappingBehavior enum. This enum accepts the following values: HideFirstLabel and HideLastLabel.

indentFromTick

Specifies the spacing between scale labels and ticks.

Type: Number
Default Value: 10

Show Example:
jQuery

In this example, the scale labels are indented from the scale ticks by 20 pixels.


                                    

                                    

overlappingBehavior

Decides how to arrange scale labels when there is not enough space to keep all of them.

Type: String|Object
Default Value: 'hide'
Accepted Values: 'hide' | 'none'

When scale labels overlap each other, you can rearrange them by setting this option to one of the following values.

  • hide
    Hides certain scale labels leaving more space for the others.
  • none
    Leaves scale labels overlapped.

When using the widget as an ASP.NET MVC Control, specify this option using the ScaleLabelOverlappingBehavior enum. This enum accepts the following values: Hide and None.

NOTE
Specifying this option with an object is deprecated.

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

useRangeColors

Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container.

Type: Boolean
Default Value: false

To paint all scale labels in a single color, you can use the color option of the font object. Alternatively, you can paint scale labels similarly to ranges in the range container. For this purpose, assign true to the useRangeColors option.

visible

Specifies whether or not scale labels are visible on the gauge.

Type: Boolean
Default Value: true

Show Example:
jQuery

Change the visibility of the scale labels by toggling the check box under the gauge.