Source

jqplot-douglaz / examples / pieTest.html

<!DOCTYPE html>

<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Simple Test</title>
  <!--[if IE]><script language="javascript" type="text/javascript" src="../src/excanvas.js"></script><![endif]-->
  
  <link rel="stylesheet" type="text/css" href="../src/jquery.jqplot.css" />
  <link rel="stylesheet" type="text/css" href="examples.css" />
  
  <!-- BEGIN: load jquery -->
  <script language="javascript" type="text/javascript" src="../src/jquery-1.4.1.min.js"></script>
  <!-- END: load jquery -->
  
  <!-- BEGIN: load jqplot -->
  <script language="javascript" type="text/javascript" src="../src/jquery.jqplot.js"></script>
  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.pieRenderer.js"></script>
  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.trendline.js"></script>
  <!-- END: load jqplot -->

  <script type="text/javascript" language="javascript">
  
  $(document).ready(function(){
    
    $.jqplot.config.enablePlugins = true;

    plot1 = $.jqplot('pie1', [[['a',25],['b',14],['c',7]]], {
      seriesDefaults:{renderer:$.jqplot.PieRenderer, trendline:{show:true}},
      legend:{show:true, numberColumns:2}      
    });

    plot2 = $.jqplot('pie2', [[['a',25],['b',0],['c',0]]], {
      seriesDefaults:{renderer:$.jqplot.PieRenderer, trendline:{show:true}},
      legend:{show:true}      
    });

    plot3 = $.jqplot('pie3', [[['a',5],['b',0],['c',7]]], {
      seriesDefaults:{renderer:$.jqplot.PieRenderer, trendline:{show:true}},
      legend:{show:true}      
    });
    
    plot4 = $.jqplot('pie4', [[["a",1000],["b",.001],["c",.001]]], {
      seriesDefaults:{renderer:$.jqplot.PieRenderer, trendline:{show:true}},
      legend:{show:true}      
    });
    
  });
  </script>
  </head>
  <body>
<?php include "nav.inc"; ?>
    This page tests for 3 conditions.  Plotting pies with a slice that begins at 0 and ends at and near 2*pi (360 degrees), disabling the trendline plugin on pies, and plotting a pie that has a 0 value in the data set.
    <div id="pie1" style="margin-top:20px; margin-left:20px; width:200px; height:200px;"></div>
    <div id="pie2" style="margin-top:20px; margin-left:20px; width:200px; height:200px;"></div>
    <div id="pie3" style="margin-top:20px; margin-left:20px; width:200px; height:200px;"></div>
    <div id="pie4" style="margin-top:20px; margin-left:20px; width:200px; height:200px;"></div>
  </body>
</html>