This question is locked. New answers and comments are not allowed.
HI, I am trying to make a paging chart with the code:
In and in the .js:
I have added a button and on the onclic event try this:
what I am missing?
thanks
<script> var seriesData = [ { year: "2000", sales: 200 }, { year: "2001", sales: 450 }, { year: "2002", sales: 300 }, { year: "2003", sales: 125 }, { year: "2004", sales: 450 }, { year: "2005", sales: 300 }, { year: "2006", sales: 125 }, { year: "2007", sales: 450 }, { year: "2008", sales: 300 }, { year: "2009", sales: 125 }, ];</script><input id="Button1" type="button" value="Next" onclick="javascript:Next()" /><div id="myChart" data-win-control="Telerik.UI.RadChart"></div>In and in the .js:
var chart = new Telerik.UI.RadChart(myChart);var dataSource = new Telerik.Data.DataSource(seriesData);dataSource.pageSize = 4,dataSource.page = 1,dataSource.read().then(function () { //data is paged var data = dataSource.view;});chart.dataSource = dataSource;var series = new Telerik.UI.Chart.ColumnSeries();series.field = "sales";chart.series.push(series);chart.categoryAxis.field = "year";chart.refresh();I have added a button and on the onclic event try this:
function Next() { var datasource = document.getElementById("myChart").dataSource; datasource.page = 2;}what I am missing?
thanks