1. douglaz
  2. jqplot-douglaz

Source

jqplot-douglaz / examples / legendLabels.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>
  <!-- END: load jqplot -->


<script language="javascript" type="text/javascript">
$(document).ready(function(){

   s1 = [1,6,9,8];
   s2 = [4,3,1,2];
   s3 = [6,2,4,1];

   plot1 = $.jqplot('chart1',[s1, s2, s3],{
       stackSeries: true,
        seriesDefaults: {
            fill: true,
            showMarker: false
        },
       legend:{
           show:true,
           numberColumns:3,
           rendererOptions:{
               labels:["a","b", "c"]
           }
		},
		axes: {
		    xaxis:{min:1, max:4},
		    yaxis:{min:0, max:20}
		}
   });

   plot2 = $.jqplot('chart2',[s1, s2, s3],{
       stackSeries: true,
        seriesDefaults: {
            fill: true,
            showMarker: false
        },
       legend:{
           show:true,
           rendererOptions:{
               labels:["a","b", "c"]
           },
           placement:'outside'
		},
		axes: {
		    xaxis:{min:1, max:4},
		    yaxis:{min:0, max:20}
		}
   });

   plot3 = $.jqplot('chart3',[s1, s2, s3],{
       stackSeries: true,
        seriesDefaults: {
            fill: true,
            showMarker: false
        },
       legend:{
           show:true,
           rendererOptions:{
               labels:["a","b", "c"]
           },
           placement:'outside',
           location:'s',
           yoffset: 35
		},
		axes: {
		    xaxis:{min:1, max:4},
		    yaxis:{min:0, max:20}
		}
   });
   
 });
</script>
  </head>
  <body>
<?php include "nav.inc"; ?>
<div id="chart1" class="plot" style="width:500px;height:300px;"></div>
<div id="chart2" class="plot" style="width:500px;height:300px;"></div>
<div id="chart3" class="plot" style="margin-bottom:50px;width:500px;height:300px;"></div>
<p>
  </body>
</html>