2014/08/09

[jQuery]jqplotプラグインを使ってグラフを描画する

jqplotを使ってグラフを描画する方法

下のように組んだら何も考えずに出力された。

<!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/flot/0.8.2/excanvas.min.js"></script><![endif]-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="./jquery.jqplot.min.js"></script>
<script>
jQuery(function($){
  $.jqplot('chartdiv',
    [
      [
        [1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]
      ]
    ]
  );
});
</script>
<div id="chartdiv" style="height:400px;width:300px; "></div>
しかもこれIE8でも対応してくれるので、なんとも便利。

0 コメント:

コメントを投稿