LoginSignup
7
7

More than 5 years have passed since last update.

Pie Chartで曜日別ツイート数のカラフルな円グラフを描画

Last updated at Posted at 2014-10-07

曜日別ツイート数を円グラフで描画

f:id:ryosy383:20141008035030p:plain

HTMLソース

  • 参考リンク

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {

        var data = google.visualization.arrayToDataTable([
          ['曜日','ツイート数'],
          ['',   1],
          ['',   2],
          ['',   1],
          ['',   4],
          ['',   3],
          ['',   8],
          ['',   11]
        ]);

        var options = {
          title: '曜日別Tweet数'
        };

        var chart = new google.visualization.PieChart(document.getElementById('piechart'));

        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="piechart" style="width: 900px; height: 500px;"></div>
  </body>
</html>
7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7