series.name String
The name of the chart series which is visible in the legend.
Example - set the chart series name
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ name: "Series 1", data: [1, 2] },
{ name: "Series 2", data: [2, 3] }
]
});
</script>
The name can also be a template which sets the name of the series when bound to grouped data source.
The fields which can be used in the template are:
- series - the series options
- group - the data group
- group.field - the name of the field used for grouping
- group.value - the field value for this group
- group.items - the data items in this group
Example - set the chart series group name template
<div id="chart"></div>
<script>
$("#chart").kendoChart({
dataSource: {
data: [
{ value: 1, category: "One", title: "Series One" },
{ value: 2, category: "Two", title: "Series Two" }
],
group: { field: "category" }
},
series: [
{
field: "value",
name: "Category: #: group.items[0].title #"
}
]
});
</script>