|
$.ajax({
success: function (data) {
var chartData = [{ mm: data.month, total: data.total }];
$("#chart").ejChart({
series: [{
type: 'line',
dataSource: chartData,
xName: "mm",
yName: "total"
}]
// ...
});
}
});
|
|
<div id="chart"></div>
$.ajax({
type: "POST",
url: '@Url.Action("chartData", "Chart")',
async: false,
success: function (data) {
$("#chart").ejChart({
series: [{
type: 'line',
//Bind the data directly to chart and map the values to xName and yName properties
dataSource: data,
xName: "month",
yName: "total"
}],
//...
});
}
});
|