sliderMarker

Defines the options of the range selector slider markers.

Type: Object

When moving a slider, its marker displays the currently selected scale value. Use the sliderMarker object to set the required options for the range selector slider markers. For instance, you can format the markers' text, change the text font, or make the markers invisible.

View Demo

Show Example:
jQuery

In this example, several options of the sliderMarker configuration object are changed.


                                    

                                    

color

Specifies the color of the slider markers.

Type: String
Default Value: '#9B9B9B'

This option supports the following colors.

  • Hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • Predefined/cross-browser color names
  • Predefined SVG colors (not supported in Internet Explorer 8)

To set a custom color for the font used to display the slider markers' text, use the color property.

Show Example:
jQuery

In this example, the slider markers are colored in pink.


                                    

                                    

customizeText

Specifies a callback function that returns the text to be displayed by slider markers.

Type: function
Function parameters:
scaleValue: Object

Defines a scale value.

Object structure:
value: Date|Number

Specifies the scale value that is currently selected.

valueText: String

Specifies the currently selected scale value using an applied format, if the format and precision (optional) properties are specified.

Return Value: String

The text to be displayed by a slider marker.

Cannot be used in themes.

When implementing a callback function for this property, use the value displayed in a slider marker. 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.

Show Example:
jQuery

In this example, the slider markers' text is customized using the customizeText option.


                                    

                                    

font

Specifies font options for the text displayed by the range selector slider markers.

Type: Object

Show Example:
jQuery

In this example, several font options of the slider markers are changed.


                                    

                                    

format

Specifies a format for the text displayed in slider markers.

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'

Slider markers display the boundaries of the currently selected range. You can apply formatting to the text displayed by the slider markers by using one of the available formats.

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

Show Example:
jQuery

In this example, the slider marker values are formatted in a 'fixedPoint' format with the precision of 2.


                                    

                                    

invalidRangeColor

Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values.

Type: String
Default Value: 'red'

Show Example:
jQuery

In this example, if you try to select a range less than 10 and greater than 20, the slider markers will be colored in 'darkred'.


                                    

                                    

padding

Specifies the empty space between the marker's border and the marker’s text.

Type: Number
Default Value: 6

Show Example:
jQuery

In this example, the slider marker's padding option is set to 30.


                                    

                                    

placeholderSize

Specifies in pixels the height and width of the space reserved for the range selector slider markers.

Type: Number|Object
Default Value: undefined

You can set a numeric value to this property. This value will be used as a width and height of both the left and right slider markers. You can also set individual values for a width and height, and make them similar or different for the left and right slider markers. To do this, specify placeholderSize as an object. When setting this object's properties, take into account the font size of the text displayed in the slider markers.

You may need to set this property, when you need to know the exact size of the dxRangeSelector widget elements in vertical and horizontal directions. For instance, this may be required when displaying an image in the background in a stretched mode. To get the background height, subtract the scale's placeholder height and the slider markers' placeholder height from the dxRangeSelector's height. To get the background width, subtract the placeholder widths of slider markers from the dxRangeSelector's width.

Show Example:
jQuery

In this example, three range selectors are displayed. Here, the slider marker's placeholderSize option is used to reserve equal spaces for the slider markers so that the range selectors have equal widths of the main area. Uncheck the check box below to set the placeholderSize option to 'null'. In this case, the sizes of all range selector elements are calculated automatically.


                                    

                                    

precision

Specifies a precision for the formatted value displayed in slider markers.

Type: Number

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

Show Example:
jQuery

In this example, the slider marker values are formatted in a 'fixedPoint' format with the precision of 2.


                                    

                                    

visible

Indicates whether or not the slider markers are visible.

Type: Boolean
Default Value: true

Show Example:
jQuery

Toggle the check box below to change the visibility of the slider markers.