New to Kendo UI for jQuery? Start a free 30-day trial

Configures the series data labels.

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true,
            background: "yellow",
            color: "black"
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

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

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true,
            background: "lightblue"
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

The border of the labels.

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true,
            border: {
                color: "red",
                width: 2,
                dashType: "solid"
            }
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

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

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true,
            color: "red"
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

The font style of the labels. labels

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

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true,
            font: "16px Arial, sans-serif"
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

The format of the labels.

js
//sets format of the labels
format: "C"

The margin of the labels.

Default: 0

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true,
            margin: 5
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

The padding of the labels.

Default: 0

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

// sets the top and left padding to 1px
// padding right and bottom are with 0px (by default)
padding: { top: 1, left: 1 }

The label template. Template variables:

  • value- the point value
  • category- the category name
  • series- the data series
  • dataItem- the original data item used to construct the point. Will be null if binding to array.
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true,
            template: (data) => `Value: ${data.value}`
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

The visibility of the labels.

Default: false

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    seriesDefaults: {
        labels: {
            visible: true
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>