pemilu 2009

ambil hasil kota surabaya. link sumber: http://www.bps.go.id/tab_sub/view.php?tabel=1&daftar=1&id_subyek=34&notab=5

by gundam

HTML

<script src="https://www.google.com/jsapi"></script>
<div id="chart_div"></div>
<p>source: https://developers.google.com/chart/interactive/docs/quick_start
    <p>change by Gunawan. the number taken by persen * num / 100 for (jawa timur)
        <!-- Megawati Soekarno Putri/ Prabowo Subianto Susilo Bambang Yudhoyono/ Boediono Muhammad Jusuf Kalla/ Wiranto 30,42 60,32 9,26 19 450 762 --?>

JavaScript

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {
    'packages': ['corechart']
});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {

    // Create the data table.
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Topping');
    data.addColumn('number', 'Slices');
    data.addRows([
        ['Megawati Soekarno Putri', 5916922],
        ['Susilo Bambang Yudhoyono', 11732700],
        ['Muhammad Jusuf Kalla', 1801140]
    ]);

    // Set chart options
    var options = {
        'title': 'Pemilu 2009',
            'width': 400,
            'height': 300
    };

    // Instantiate and draw our chart, passing in some options.
    var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
    chart.draw(data, options);
}