New to Kendo UI for jQueryStart a free 30-day trial

Scale.labels

configuration

Configures the scale labels.

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    scale: {
        min: 0,
        max: 50,
        labels: {
            color: "#2196f3",
            font: "12px Arial",
            visible: true
        }
    }
});
</script>

The background color of the labels. Any valid CSS color string will work here, including hex and rgb

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    scale: {
        min: 0,
        max: 50,
        labels: {
            background: "#fff3e0",
            color: "#e65100"
        }
    }
});
</script>

The border of the labels.

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    scale: {
        min: 0,
        max: 50,
        labels: {
            background: "#ffffff",
            border: {
                color: "#2196f3",
                width: 1,
                dashType: "solid"
            }
        }
    }
});
</script>

The text color of the labels. Any valid CSS color string will work here, including hex and rgb.

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    scale: {
        min: 0,
        max: 50,
        labels: {
            color: "#9c27b0"
        }
    }
});
</script>

The font style of the labels.

Default: "12px Arial,Helvetica,sans-serif"

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    scale: {
        min: 0,
        max: 50,
        labels: {
            font: "16px Verdana",
            color: "#3f51b5"
        }
    }
});
</script>

The format of the labels.

<div id="linear-gauge"></div>
<script>
$("#linear-gauge").kendoLinearGauge({
    scale: {
        labels: {
            // set the format to currency
            format: "C"
        }
    }
});
</script>
Number|Object

The margin of the labels.

Default: 5

js
// sets the top, right, bottom and left margin to 3px.
margin: 3

// sets the top and left margin to 1px
// margin right and bottom are with 5px (by default)
margin: { top: 1, left: 1 }
Number | Object

The padding of the labels.

Default: 0

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    scale: {
        min: 0,
        max: 50,
        labels: {
            padding: 5,
            background: "#f5f5f5"
        }
    }
});
</script>

scale.labels.template

String|Function

The label template. Template variables:

  • value - the value
<div id="linear-gauge"></div>
<script>
  // gauge initialization
$("#linear-gauge").kendoLinearGauge({
    scale: {
        labels: {
            // labels template
            template: "#= value #%"
        }
    }
});
</script>

The visibility of the labels.

Default: true

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    scale: {
        min: 0,
        max: 50,
        labels: {
            visible: false
        }
    }
});
</script>