Blame view

datalets/google_piechart-datalet/demo/index.html 1.23 KB
331a2265   Renato De Donato   google-chart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  <!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>