series.name String

The series name visible in the legend.

Example - set the series name

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
  dataSource: {
    data: [
      { value: 1, category: "One", date: new Date(2012, 1, 1)},
      { value: 2, category: "Two", date: new Date(2012, 1, 2)}
    ]
  },
  dateField: "date",
  series: [
    {
      field: "value",
      name: "Value"
    }
  ],
  legend: {
    visible: true,
    position: "bottom"
  }
});
</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.

Example - set the chart series group name template

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
  dataSource: {
    data: [
      { value: 1, category: "One", date: new Date(2012, 1, 1)},
      { value: 2, category: "Two", date: new Date(2012, 1, 2)}
    ],
    group: { field: "category" }
  },
  dateField: "date",
  series: [
    {
      field: "value",
      name: "Category: #: group.value #"
    }
  ],
  legend: {
    visible: true,
    position: "bottom"
  }
});
</script>
In this article