I want to design a pie chart using jquery,html,css how? how to get daily report in pie chart representation using the code. By Teja
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
var test=new Array();
function drawChart() {
var jsonData = $.ajax({
url:'getData.php',
type:'GET',
dataType:'json',
contentType: 'application/x-www-form-urlencoded',
async:false,
success: function(data){
test=data;
}
}).responseText;
//alert(test);
var data = google.visualization.arrayToDataTable(test);
var options = {
title: 'My Daily Activities',
pieHole: 0.6,
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="piechart" style="width: 900px; height: 500px;"></div>
</body>
</html>
And I am not able to get any out put and i am getting all json data using different file and getting json data using Ajax code in my code ... is there any other way to solve this issue.
</div>