seriesDefaults.labelsObject
Configures the series data labels.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true,
background: "yellow",
color: "black"
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>
seriesDefaults.labels.backgroundString
The background color of the labels. Any valid CSS color string will work here, including hex and rgb.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true,
background: "lightblue"
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>
seriesDefaults.labels.borderObject
The border of the labels.
Example
<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>
seriesDefaults.labels.border.colorString(default: "black")
The color of the border.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true,
border: {
color: "green"
}
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>
seriesDefaults.labels.border.dashTypeString(default: "solid")
The dash type of the border.
"solid"
Specifies a solid line.
"dot"
Specifies a line consisting of dots.
"dash"
Specifies a line consisting of dashes.
"longDash"
Specifies a line consisting of a repeating pattern of long-dash.
"dashDot"
Specifies a line consisting of a repeating pattern of dash-dot.
"longDashDot"
Specifies a line consisting of a repeating pattern of long-dash-dot.
"longDashDotDot"
Specifies a line consisting of a repeating pattern of long-dash-dot-dot.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true,
border: {
dashType: "dash",
color: "red",
width: 2
}
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>
seriesDefaults.labels.border.widthNumber(default: 0)
The width of the border.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true,
border: {
width: 3,
color: "blue"
}
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>
seriesDefaults.labels.colorString
The text color of the labels. Any valid CSS color string will work here, including hex and rgb.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true,
color: "red"
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>
seriesDefaults.labels.fontString(default: "12px Arial,Helvetica,sans-serif")
The font style of the labels. labels
Example
<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>
seriesDefaults.labels.formatString
seriesDefaults.labels.marginNumber|Object(default: 0)
The margin of the labels.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true,
margin: 5
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>
seriesDefaults.labels.paddingNumber|Object(default: 0)
The padding of the labels.
Example
// 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 }
seriesDefaults.labels.templateString | Function
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.
Example
<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>
seriesDefaults.labels.visibleBoolean(default: false)
The visibility of the labels.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
type: "column",
seriesDefaults: {
labels: {
visible: true
}
},
series: [{
data: [10, 15, 8, 12]
}]
});
</script>