series.labelsObject
Configures the series data labels.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
background: "yellow",
color: "black"
}
}]
});
</script>
"circle"
The labels are positioned in circle around the chart.
"column"
The labels are positioned in columns to the left and right of the chart.
series.labels.backgroundString|Function
The background color of the labels.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
background: "lightblue"
}
}]
});
</script>
series.labels.borderObject
The border of the labels.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
border: {
color: "red",
width: 1
}
}
}]
});
</script>
series.labels.border.colorString|Function(default: "black")
The color of the border.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
border: {
color: "blue"
}
}
}]
});
</script>
series.labels.border.dashTypeString|Function(default: "solid")
The dash type of the border.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
border: {
dashType: "dash"
}
}
}]
});
</script>
"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.
series.labels.border.widthNumber|Function(default: 0)
The width of the border.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
border: {
width: 2
}
}
}]
});
</script>
series.labels.colorString|Function
The text color of the labels.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
color: "red"
}
}]
});
</script>
series.labels.fontString|Function(default: "12px Arial,Helvetica,sans-serif")
The font style of the labels.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true,
font: "16px Arial"
}
}]
});
</script>
series.labels.formatString|Function
series.labels.marginNumber|Object(default: { left: 5, right: 5})
The margin of the labels.
Example
// sets the top, right, bottom and left margin to 3px.
margin: 3
// sets the top and bottom margin to 1px
// margin left and right are with 5px (by default)
margin: { top: 1, bottom: 1 }
series.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 }
series.labels.positionString|Function(default: "above")
Defines the position of the labels.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "line",
field: "close",
labels: {
visible: true,
position: "above"
}
}]
});
</script>
"above"
The label is positioned at the top of the marker.
** Applicable for area and line series. **
"center"
The label is positioned at the point center.
** Applicable for column series only. **
"insideEnd"
The label is positioned inside, near the end of the point.
** Applicable for column series only. **
"insideBase"
The label is positioned inside, near the base of the bar.
** Applicable for column series. **
"outsideEnd"
The label is positioned outside, near the end of the bar.
** Applicable for column series only. Not applicable for stacked series. **
"right"
The label is positioned to the right of the marker.
** Applicable for area and line series. **
"below"
The label is positioned at the bottom of the marker.
** Applicable for area and line series. **
"left"
The label is positioned to the left of the marker.
** Applicable for area and line series. **
series.labels.templateString | Function
The template which renders the chart series label.
The fields which can be used in the template are:
- category - the category name. Available for area, bar, column, bubble, donut, line and pie series.
- dataItem - the original data item used to construct the point. Will be null if binding to array.
- percentage - the point value represented as a percentage value. Available only for 100% stacked charts.
- series - the data series
- value - the point value. Can be a number or object containing each bound field.
Example
// chart initialization
$("#chart").kendoChart({
title: {
text: "My Chart Title"
},
series: [
{
type: "area",
name: "Series 1",
data: [200, 450, 300, 125],
labels: {
// label template
template: "#= value #%",
visible: true
}
}
],
categoryAxis: {
categories: [2000, 2001, 2002, 2003]
}
});
series.labels.visibleBoolean|Function(default: false)
The visibility of the labels.
Example
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
dataSource: {
data: [
{ date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
{ date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
]
},
dateField: "date",
series: [{
type: "candlestick",
openField: "open",
highField: "high",
lowField: "low",
closeField: "close",
labels: {
visible: true
}
}]
});
</script>