index.html 1.23 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>

    <script src="https://code.jquery.com/jquery-2.1.4.min.js" type="text/javascript"></script>

    <link rel="import" href="../google_piechart-datalet.html" />

    <style>
        #google_piechart_container{
            height: 400px;
            width: 1000px;
        }
    </style>

    <div id="google_piechart_container">

        <google_piechart-datalet id="pie" data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&amp;limit=5"
                                 fields='["result,records,Location","result,records,_id"]'></google_piechart-datalet>

        <button onclick="_3D()">3D!</button>
        <button onclick="_pieHole()">pie hole!</button>
        <button onclick="_title()">Sbiricuda!</button>

    </div>

    <script>
        function _3D() {
            $("#pie")[0].is3D = !$("#pie")[0].is3D;
        }
        function _pieHole() {
            $("#pie")[0].is3D = false;
            $("#pie")[0].pieHole = ($("#pie")[0].pieHole + 0.5) % 1;
        }
        function _title() {
            $("#pie")[0]._title = $("#pie")[0]._title + "sbiricuda... ";
        }
    </script>

</body>
</html>