when i am passing dynamic data like below it does not show the Line chart, can any body help me.
http://morrisjs.github.io/morris.js/lines.html
$.ajax({
type: "POST",
dataType: 'json',
async: false,
url: "wfDashboard.aspx/BindChart",
cache: false,
data: '{}',
contentType: "application/json; charset=utf-8",
success: function (msg) {
var source= msg.d._DESC
Morris.Line({
element: 'line-example',
data: source,
xkey: 'Date',
ykeys: ['A', 'B', 'C'],
labels: ['XYZ', 'ABC', 'PQR'],
lineColors: ['#0aa699']
});
}
});
and my source look like
source=[{'Date':'2014-8','A':'6500.00','B':'6566.00','C':'561265.00'},
{'Date':'2014-9','A':'10000.00','B':'14000.00','C':'459434.00'}]
When i hard-code the same data in morris line chart its work fine
Morris.Line({
element: 'line-example',
data: [{'Date':'2014-8','A':'6500.00','B':'6566.00','C':'561265.00'},
{'Date':'2014-9','A':'10000.00','B':'14000.00','C':'459434.00'}],
xkey: 'Date',
ykeys: ['A', 'B', 'C'],
labels: ['XYZ', 'ABC', 'PQR'],
lineColors: ['#0aa699']
});