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

Series.tooltip

configuration

The data point tooltip configuration options.

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

The background color of the tooltip. The default is determined from the series color.

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

The border configuration options.

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

The text color of the tooltip. The default is the same as the series labels color.

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

The tooltip font.

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

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

The tooltip format. Format variables depend on the series type:

  • Area, bar, column, line and pie
    • 0- value
js
//sets format of the tooltip
format: "{0:C}--{1:C}"

The padding of the tooltip.

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

// sets the top and left padding to 1px
// right and bottom padding are left at their default values
padding: { top: 1, left: 1 }

The tooltip template. Template variables:

  • value- the point value (either a number or an object)
  • 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.
js
$("#sparkline").kendoSparkline({
     series: [{
         type: "area",
         data: [200, 450, 300, 125],
         tooltip: {
             visible: true,
             template: "#= value #"
         }
     }]
});

A value indicating if the tooltip should be displayed.

Default: true

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