Hi,
Here is my json code from data1.php file which I am using in data.php.
[{“label”:”2014-09-10″,”y”:”58751″},{“label”:”2014-09-09″,”y”:”264396″},{“label”:”2014-09-08″,”y”:”234439″},{“label”:”2014-09-07″,”y”:”179431″},{“label”:”2014-09-06″,”y”:”182605″},{“label”:”2014-09-05″,”y”:”226082″},{“label”:”2014-09-04″,”y”:”239130″}]
Here is data.php file
<!DOCTYPE html>
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head>
<title>Loading Status</title>
<script src=”jquery.php”></script>
<script src=”canvasjs.php”></script>
<script type=”text/javascript”>
$(document).ready(function () {
$.getJSON(“data1.php”, function (result) {
var chart = new CanvasJS.Chart(“chartContainer”, {
data: [
{
dataPoints: result
}
]
});
chart.render();
});
});
</script>
</head>
<body>
<div id=”chartContainer” style=”height: 300px; width: 100%;”>
</div>
</body>
</html>
Only X co-orddinate is rendered and Y is not displayed.
Please help me.