flot 例子代码

来源:互联网 发布:淘宝会员冻结怎么解冻 编辑:程序博客网 时间:2024/05/16 12:52
 
  1. <html>  
  2. <head>  
  3.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
  4.     <title>flot</title>  
  5.     <!--[if lte IE 8]>  
  6.         <script language="javascript" type="text/javascript" src="excanvas.min.js"></script>  
  7.     <![endif]-->  
  8.     <script type="text/javascript" src="jquery.js"></script>  
  9.     <script type="text/javascript" src="jquery.flot.js"></script>  
  10. </head>  
  11. <body>  
  12.   
  13. <script type="text/javascript">  
  14. <!--   
  15. var data = [];   
  16. data.push({   
  17.     "label": "中国",   
  18.     "data": [[2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1]]   
  19. });   
  20.   
  21. $(function(){   
  22.     var options = {   
  23.         lines: { show: true },   
  24.         points: { show: true },   
  25.         xaxis: { tickDecimals: 0, tickSize: 1 }   
  26.     };   
  27.     var placeholder = $("#placeholder");   
  28.     $.plot(placeholder, data, options);   
  29. });   
  30. //-->  
  31. </script>  
  32.   
  33. <div id="placeholder" style="width:500px;height:240px"></div>  
  34.   
  35. </body>  
  36. </html>