You mean Like This?
Code:
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
$.getJSON("https://api.covid19india.org/data.json", function(data){
$.each(data.statewise, function(key, value){
if (value.state === "Total") {
var data2 = [['Covid19', 'Stats'],
['Active cases',value.active],
['Deaths', value.deaths],
['recovered', value.recovered],];
}
});
});
var data = google.visualization.arrayToDataTable(data2);
var options = {
width:"350",
height:"350",
pieHole: 0.5,
backgroundColor: { fill:"transparent"},
chartArea:{
left:10,
right:10, // !!! works !!!
bottom:20, // !!! works !!!
top:20,
width:"100%",
height:"100%"
},
pieSliceTextStyle: {
color: "white",
},
legend: {position: "bottom", textStyle: {color: "gray"}},
pieSliceText: "none",
};
var chart = new
google.visualization.PieChart(document.getElementById('covid19'));
chart.draw(data, options);
}
Still not working!
I will be very thankful to you sir, if you can send me right code here.
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/01d751cf-dcdf-454d-b7aa-2e0c9a67e3e9%40googlegroups.com.