JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://www.google.com/jsapi?dummy=.js"></script>
<div id="chart_div"></div>
JavaScript
google.load('visualization', '1.1', {
'packages': ['corechart']
});
google.setOnLoadCallback(drawStuff);
function drawStuff() {
var data = new google.visualization.DataTable({
"cols": [{
"id": "name",
"label": "Name",
"type": "string"
}, {
"id": "incomes",
"label": "Incomes",
"type": "number"
}],
"rows": [{
"c": [{
"v": "Kaufland"
}, {
"v": 48
}]
}, {
"c": [{
"v": "Billa"
}, {
"v": 24
}]
}, {
"c": [{
"v": "Hans"
}, {
"v": 42
}]
}]
});
var options = {
title: '',
pieHole: 0.4,
width: '380',
height: '300',
'chartArea': {
'width': '100%',
'height': '80%',
left: 10,
top: '20',
right: 10
},
backgroundColor: '#FFFFFF',
pieSliceText: 'none',
legend: {
position: 'labeled'
},
colors: ['#1abc9c', '#2ecc71', '#3498db', '#9b59b6', '#34495e',
'#16a085', '#2cc36b', '#2980b9', '#8e44ad', '#2c3e50',
'#f1c40f', '#e67e22', '#e74c3c', '#ecf0f1', '#95a5a6',
'#f39c12', '#d35400', '#c0392b', '#bdc3c7', '#7f8c8d']
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
};