google.charts.load('current', {
callback: function() {
var data = google.visualization.arrayToDataTable([
['Language', 'Speakers (in millions)'],
['Assamese', 13], ['Bengali', 83], ['Bodo', 14],
['Dogri', 23], ['Gujarati', 46], ['Hindi', 300],
['Kannada', 38], ['Kashmiri', 5.5], ['Konkani', 5],
['Maithili', 20], ['Malayalam', 33], ['Manipuri', 1.5],
['Marathi', 72], ['Nepali', 2.9], ['Oriya', 33],
['Punjabi', 29], ['Sanskrit', 0.01], ['Santhali', 6.5],
['Sindhi', 2.5], ['Tamil', 61], ['Telugu', 74], ['Urdu', 52]
]);
var pieChart = new google.visualization.ChartWrapper({
chartType: 'PieChart',
containerId: 'chart_div',
dataTable: data,
options: {
height: 400,
width: 400
}
});
pieChart.setOption('slices', {
0: {offset: 0.05},
1: {offset: 0.15},
2: {offset: 0.25},
3: {offset: 0.35}
});
pieChart.draw();
},
packages:['controls', 'corechart']
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>
道歉的白帽,我離開了一段時間 - 偉大的答案,謝謝你的幫助。 –