setDataSource

Sets the data source of the widget.

Parameters

dataSource kendo.data.DataSource

The data source to which the widget should be bound.

Example - set the data source

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  dataSource: [
    { value: 1 },
    { value: 2 }
  ],
  series: [
    { field: "value" }
  ]
});
var chart = $("#chart").data("kendoChart");
var dataSource = new kendo.data.DataSource( {
  data: [
    { value: 3 },
    { value: 4 }
  ]
});
chart.setDataSource(dataSource);
</script>
In this article