I am using highchart js for creating line chart.I am using php for json response. Problem is when i am populating the chart from response the years are display but line is not drawing.
$(document).ready(function () {
$.ajax({
type: "GET",
url: 'resp_highChart.php',
dataType: "json",
contentType: "application/json",
success: function (response) {
console.log(response);
// draw chart
$('#container').highcharts({
chart: {
type: 'line'
},
title: {
text: 'Year Wise Sales Data'
},
subtitle: {
text: ''
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr']
},
yAxis: {
title: {
text: 'Sold Value'
},
labels: {
formatter: function () {
return this.value + '';
}
}
},
plotOptions: {
line: {
dataLabels: {
enabled: false
},
enableMouseTracking: true
}
},
series: response
});
}
});
});
my response format is below
[{"name":"2012","data":"[692101643,716334837,776991835,769420169 ]"},{"name":"2013","data":"[860859252,825852169,895524501,892930333 ]"}]