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

The crosshair tooltip configuration options.

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

The background color of the tooltip.

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

The border configuration options.

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

The text color of the tooltip.

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

The tooltip font.

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

<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
    type: "column",
    valueAxis: {
        crosshair: {
            visible: true,
            tooltip: {
                visible: true,
                font: "14px Georgia, serif"
            }
        }
    },
    series: [{
        data: [10, 15, 8, 12]
    }]
});
</script>

The tooltip format.

js
//sets format of the tooltip
format: "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)
js
// chart initialization
$("#sparkline").kendoSparkline({
     data: [200, 450, 300, 125],
     valueAxis: {
         crosshair: {
             visible: true,
             tooltip: {
                 visible: true,
                 template: "value: #= value #"
             }
         }
     }
});

A value indicating if the tooltip should be displayed.

Default: false

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