8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Google Chart Tools

Last updated at Posted at 2015-12-08

#Google Chartを使ってみよう!

下記のような感じで使えます!
「グラフ作って!」という時には便利かもしれません。
optionsも色々指定できるみたいです♪

sample.png

sample.html
<html>
 <script type="text/javascript" src="http://www.google.com/jsapi"></script>
 <script type="text/javascript">
   google.load("visualization", "1", {packages:["corechart"]});
   google.setOnLoadCallback(draw);
   function draw() {
     var data = google.visualization.arrayToDataTable([
       ['年月', '身長', '体重'],
       ['2011年', 173, 55],
       ['2012年', 175, 70],
       ['2013年', 180, 68],
       ['2014年', 175, 67],
       ['2015年', 173, 65]
     ]);
 
     var options = {
       title: '年別身長体重サンプル',
       hAxis: {title: '年月'},
       vAxis: {title: 'cm/kg'},
       width: 500,
       height: 250,
       pointSize: 6
     };
 
     var chart = new google.visualization.LineChart(document.getElementById('sample'));
     chart.draw(data, options);
   }
 </script>
<body>
 <div id="sample" style="width: 400px;"></div>
</body>
</html>

■参考文献

http://yohshiy.blog.fc2.com/blog-entry-195.html

8
8
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
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?