or
var _detailDataSource = new kendo.data.DataSource({
transport: {
read: {
type: "POST",
url: "/Admin/GetDetailUsage",
dataType: "json",
data: {
beginDate: function () {
return $('#beginDate').val();
},
endDate: function () {
return $('#endDate').val();
}
}
}
},
schema: {
model: {
fields: {
RequestId: { type: "number" },
RequestDate: { type: "date" },
Interface: { type: "string" },
ProviderName: { type: "string" },
EmployeeId: { type: "string" },
EmployeeName: { type: "string" },
EmployeeType: { type: "string" },
Department: { type: "string" }
}
}
},
pageSize: 20
});
function dashboardChart() {
$("#chart").kendoChart({
dataSource: _detailDataSource,
title: {
text: "Units sold"
},
series: [{
type: "area",
field: "RequestId",
aggregate: "count"
}],
categoryAxis: {
baseUnit: "weeks",
field: "RequestDate"
}
});
}
and then I call the chart like so: dashboardChart();
So, can someone tell me what I'm doing wrong? I want to aggregate the data from the datasource by week and display the number of Requests in an area chart.
Thanks,
Chad.

.kendoChart(data)kendo.destroy()<html> <head> <script src="js/jquery-1.8.2.min.js"></script> <script src="js/kendo.dataviz.min.js"></script> <script> var data = { theme: $(document).data("kendoSkin") || "default", title: { text: "Internet Users" }, legend: { position: "bottom" }, chartArea: { background: "" }, seriesDefaults: { type: "bar" }, series: [{ name: "World", data: [15.7, 16.7, 20, 23.5, 26.6] }, { name: "United States", data: [67.96, 68.93, 75, 74, 78] }], valueAxis: { labels: { format: "{0}%" } }, categoryAxis: { categories: [2005, 2006, 2007, 2008, 2009] }, tooltip: { visible: true, format: "{0}%" } }; $(document).ready(function() { window.iteration = 0; window.of = 10; $('input').on('click', function() { refreshCharts(); $(this).hide(); $('p.iteration').html('Starting...'); return false; }); }); function refreshCharts() { setTimeout(function() { removeCharts(); addCharts(); window.iteration++; $('p.iteration').html('Iteration: ' + window.iteration + ' of ' + window.of); if (window.iteration < window.of) { refreshCharts(); } else { $('p.iteration').html('Completed'); } }, 2000); } function addCharts() { for (var i = 0; i < 50; i++) { addChart(); } } function addChart() { $('<div></div>') .addClass('chart') .css({'float': 'left', 'clear': 'both', 'width': '400', 'height': '400', 'background-color': '#fff', 'margin': '2px'}) .appendTo($('div.content')) .kendoChart(data); } function removeCharts() { $('div.chart').each(function() { kendo.destroy($(this)); $(this).remove(); }); } </script> </head> <body> <p>KENDO UI</p> <p class="iteration"></p> <p><input type="button" value="Start"/></p> <div class="content"></div> </body></html>