I was trying to use multiple google charts on tables cells but I get that only once instance can be used. More info. Im using this code
...looping so I get and set percentFromtable JS value
<tr>
<td>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['percent', percentFromtable],
['REst', 100 - percentFromtable],
]);
var options = {
title: 'My Daily Activities',
pieHole: 0.4,
};
var chart = new google.visualization.PieChart(document.getElementById('donutchart'));
chart.draw(data, options);
}
</script>
<div id="donutchart" style="width: 900px; height: 500px;"></div>
......
but I get only one chart, on the others cells I get a empty space. Probably I have to declare an array of data but want to check with the community for the proper way. Thanks, if more details its needed just tell.