Answer the question
In order to leave comments, you need to log in
How to remove padding before and after pie chart (Google Pie Chart)?
Good afternoon!
Can you please tell me how to remove the padding before and after the pie chart? I use google tools to build graphs and charts: developers.google.com
Screenshot of how it looks like for me now:
Generated code:
<script src="https://www.google.com/jsapi "></script>
<script>
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Результат', 'Процент сборок'],
['Успех', 61.15],
['Провал', 38.85]
]);
var options = {
title: 'Результаты для Main, %',
pieHole: 0.5,
pieSliceTextStyle: {
color: 'black',
position: 'center'
},
slices: {
0: { color: '#90EE90' },
1: { color: '#FA8072' }
}
};
var chart = new google.visualization.PieChart(document.getElementById('Main'));
chart.draw(data, options);
}
</script>
<script src="https://www.google.com/jsapi "></script>
<script>
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Результат', 'Процент сборок'],
['Успех', 95.65],
['Провал', 4.35]
]);
var options = {
title: 'Результаты для Release, %',
pieHole: 0.5,
pieSliceTextStyle: {
color: 'black',
position: 'center'
},
slices: {
0: { color: '#90EE90' },
1: { color: '#FA8072' }
}
};
var chart = new google.visualization.PieChart(document.getElementById('Release'));
chart.draw(data, options);
}
</script>
<table border="0">
<tr>
<td><div id="Main" style="width: 500px; height: 400px;">96 %</div></td>
<td><div id="Release" style="width: 500px; height: 400px;">96 %</div></td>
</tr>
</table>
Answer the question
In order to leave comments, you need to log in
This helped me, though on a different type of diagram, but I think it will work here too):
var options = {
chartArea: {top:0, height:'100%'},
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question