I have multiple pie charts that are in a table. How can i remove the space between them?
I tried a lot if different options (making the div element smaller, this: Remove padding or margins from Google Charts, or this: remove space between two td elements in a table), but nothing worked.
This is my code: JS
function drawPieCharts(countChoices, name) {
var rows = [];
for (var property in countChoices) {
if (countChoices.hasOwnProperty(property)) {
rows.push([property, countChoices[property]]);
}
}
var datatable = new google.visualization.DataTable();
datatable.addColumn('string', 'Type');
datatable.addColumn('number', 'Quantity');
datatable.addRows(rows);
var options = {
title: String(name),
is3D: 'true',
};
var chart = new google.visualization.PieChart(document.getElementById(String(name)));
chart.draw(datatable, options);
}
and the html code
</head>
<body>
<!--Table and divs that hold the charts-->
<table width="50%">
<tr>
<td><div id="1" style="width:700px;height:500px;"></div></td>
<td><div id="2" style="width:700px;height:500px;"></div></td>
</tr>
<tr>
<td><div id="3" style="width:700px;height:500px;"></div></td>
<td><div id="4" style="width:700px;height:500px;"></div></td>
</tr>
<tr>
<td><div id="5" style="width:700px;height:500px;"></div></td>
<td><div id="6" style="width:700px;height:500px;"></div></td>
</tr>
<tr>
<td><div id="7" style="width:1000px;height:500px;"></div></td>
</tr>
</table>
</body>
</html>