I am confused about chart behavior when the chart is bound to a datasource that is shared by multiple widgets.
Specifically, I have a chart and a grid that share a datasource. When I page through the data via the grid, the datasource is firing off change events but the chart seems to remain oblivious. So I had to write an extra function:
This function is used as the dataSource change event handler. If I just try chart.refresh() its as if the dataSource hasnt been changed even though it clearly has.
Questions:
Why is it that when the grid manipulates the dataSource and the refresh method on the chart is called, the chart data remains the same?
Is the above method the best way to tell the chart to change?
Specifically, I have a chart and a grid that share a datasource. When I page through the data via the grid, the datasource is firing off change events but the chart seems to remain oblivious. So I had to write an extra function:
01.var statsByUserDataChange = function(e) {02. var chart = $("#x-by-user").data("kendoChart");03. 04. if( chart.dataSource.page() !== e.sender.page() ) {05. chart.dataSource.page(e.sender.page());06. }07. 08. if( chart.dataSource.sort() !== e.sender.sort() ) {09. chart.dataSource.sort(e.sender.sort());10. }11. 12. chart.refresh();13.};This function is used as the dataSource change event handler. If I just try chart.refresh() its as if the dataSource hasnt been changed even though it clearly has.
Questions:
Why is it that when the grid manipulates the dataSource and the refresh method on the chart is called, the chart data remains the same?
Is the above method the best way to tell the chart to change?