Chris Leonello avatar Chris Leonello committed 7688a54

Lots of documentation additions, updates and changes.

Comments (0)

Files changed (20)

 
 File: jqPlot  (no auto-title, jqplot.core.js)
 File: Usage  (no auto-title, usage.txt)
+File: Change Log  (changes.txt)
 Link: Unit Tests & Examples  (../../tests/)
 
 Group: Core Renderers  {

changes.txt

-jqPlot change log
-
-0.7.0
-
-* Pie chart support
-* Enabled tooltipLocation option in highlighter. 
-* Highlighter Tooltip will account for mark size and highlight size when positioning itself. 
-* Added ability to show just x, y or both axes in highlighter tooltip.
-* Modified how shadows are drawn for lines, bars and markers.  Now drawn first, so they are
-  always behind the object.
-* Adjustments to shadow parameters on lines to account for new shadow positioning.
-* Added a ColorGenerator class to robustly return next available color for a plot with wrap
-  around to first color at end.
-* Udates to docs about css file.
-* Fixed bug with String x values in series and IE error on sorting (Category Axis).
-
-0.6.6b
-
-* Added excanvas.js and excanvas.min.js to compressed distributions.
-* Added example/test html pages I had locally into repository and to compressed distributions.
-
-0.6.6a
-
-* Duplicate of 0.6.6 with a suffix to unambiguously differentiate between previously posted 0.6.6 release.
-
-0.6.6
-
-* Fixed bug #5, trend line plugin failing when no trend line options specified.
-* Enhancement to category axes, more intuitive handling of series with missing data values.
-
-0.6.5
-
-* Fixed bug #4, series of unequal data length not rendering correctly.
-  This is a bugfix release only.
-
-0.6.4
-
-* Fixed bug (issue #1 in tracker) where flat line data series (all x and/or y values are euqal)
-  or single value data series would crash.
-
-0.6.3
-
-* Support for stacked line (a.k.a. area) and stacked bar (horizontal and vertical) charts.
-* Refactored barRenderer to use default shape and shadow renderers.
-* Added info (contacts & support information) page to web site.
-
-0.6.2
-
-* This is a minor upgrade to docs and build only.  No functionality has changed.
-* Ant build script generates entire site, examples, tests and distribution.
-* Improvements to documentation.
-
-0.6.1
-
-* New sprintf implementation from Ash Searle that implements %g.
-* Fix to sprintf e/f formats.
-* Created new format specifier, %p and %P to preserve significance.
-* Modified p/P format to better display larger numbers.
-* Fixed and simplified significant digits calculation for sprintf.
-* Added option to have cursor tooltip follow the mouse or not.
-* Added options to change size of highlight.
-* Updates to handle dates like '6-May-09'.
-* Mods to improve look of web site.
-* Updates to documentation.
-* Added license and copyright statement to source files.
-
-0.6.0
-
-* Added rotated text support.  Uses native canvas text functionality in
-browsers that support it or draws text on canvas with Hershey font
-* metrics for non-supporting browsers.
-* Removed lots of lint in js code.
-* Moved tick css from js code into css file.
-* Fix to tick positioning css.  y axis ticks were positioned to wrong side of axis div.
-* Refactored axis tick renderer instantiation into the axes renderers themselves.
-
-
-For chnages prior to 0.6.0 release, please see change log at http://bitbucket.org/cleonello/jqplot/changesets/
+Title: Change Log
+
+0.7.0
+
+* Pie chart support
+* Enabled tooltipLocation option in highlighter. 
+* Highlighter Tooltip will account for mark size and highlight size when positioning itself. 
+* Added ability to show just x, y or both axes in highlighter tooltip.
+* Added customization of separator between axes values in highlighter tooltip.
+* Modified how shadows are drawn for lines, bars and markers.  Now drawn first, so they are
+  always behind the object.
+* Adjustments to shadow parameters on lines to account for new shadow positioning.
+* Added a ColorGenerator class to robustly return next available color for a plot with wrap
+  around to first color at end.
+* Udates to docs about css file.
+* Fixed bug with String x values in series and IE error on sorting (Category Axis).
+
+0.6.6b
+
+* Added excanvas.js and excanvas.min.js to compressed distributions.
+* Added example/test html pages I had locally into repository and to compressed distributions.
+
+0.6.6a
+
+* Removed absolute positioning from dom element and put back into css file.
+* Duplicate of 0.6.6 with a suffix to unambiguously differentiate between previously posted 0.6.6 release.
+
+0.6.6
+
+* Fixed bug #5, trend line plugin failing when no trend line options specified.
+* Added absolute position css spec to axis tick dom element.
+* Enhancement to category axes, more intuitive handling of series with missing data values.
+
+0.6.5
+
+* Fixed bug #4, series of unequal data length not rendering correctly.
+  This is a bugfix release only.
+
+0.6.4
+
+* Fixed bug (issue #1 in tracker) where flat line data series (all x and/or y values are euqal)
+  or single value data series would crash.
+
+0.6.3
+
+* Support for stacked line (a.k.a. area) and stacked bar (horizontal and vertical) charts.
+* Refactored barRenderer to use default shape and shadow renderers.
+* Added info (contacts & support information) page to web site.
+
+0.6.2
+
+* This is a minor upgrade to docs and build only.  No functionality has changed.
+* Ant build script generates entire site, examples, tests and distribution.
+* Improvements to documentation.
+
+0.6.1
+
+* New sprintf implementation from Ash Searle that implements %g.
+* Fix to sprintf e/f formats.
+* Created new format specifier, %p and %P to preserve significance.
+* Modified p/P format to better display larger numbers.
+* Fixed and simplified significant digits calculation for sprintf.
+* Added option to have cursor tooltip follow the mouse or not.
+* Added options to change size of highlight.
+* Updates to handle dates like '6-May-09'.
+* Mods to improve look of web site.
+* Updates to documentation.
+* Added license and copyright statement to source files.
+
+0.6.0
+
+* Added rotated text support.  Uses native canvas text functionality in
+browsers that support it or draws text on canvas with Hershey font
+* metrics for non-supporting browsers.
+* Removed lots of lint in js code.
+* Moved tick css from js code into css file.
+* Fix to tick positioning css.  y axis ticks were positioned to wrong side of axis div.
+* Refactored axis tick renderer instantiation into the axes renderers themselves.
+
+
+For chnages prior to 0.6.0 release, please see change log at http://bitbucket.org/cleonello/jqplot/changesets/

src/jqplot.core.js

  * 
  * See <jqPlot Usage>
  * 
+ * About: Changes
+ * 
+ * See <Change Log>
+ * 
 **/
 
 (function($) {
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+
+<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" />
+  
+  <!-- BEGIN: load jquery -->
+  <script language="javascript" type="text/javascript" src="./src/jquery-1.3.2.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.logAxisRenderer.js"></script>
+
+  <!-- END: load jqplot -->
+  <style type="text/css" media="screen">
+    .jqplot-axis {
+      font-size: 0.85em;
+    }
+  </style>
+  <script type="text/javascript" language="javascript">
+  
+  $(document).ready(function(){
+
+line2 = [25, 12.5, 6.25, 3.125];
+plot1 = $.jqplot('chart', [line2], {
+    legend: {
+        show: true,
+        location: 'ne'
+    },
+    title: 'Log Y Axis, Power Tick Distribution',
+    series: [{
+        label: 'Declining line'
+    }],
+    axes: {
+        xaxis: {
+            min: 0,
+            max: 5
+        },
+        yaxis: {
+            renderer: $.jqplot.LogAxisRenderer
+        }
+    }
+});
+
+
+  });
+  </script>
+  </head>
+  <body>
+    <div id="chart" style="margin-top:20px; margin-left:20px; width:360px; height:300px;"></div>
+  </body>
+</html>
 line1 = [[2006, 4],            [2008, 9], [2009, 16]];
 line2 = [[2006, 3], [2007, 7], [2008, 6]];
 line3 = [[2006, 5], [2007, 1], [2008, 3], [2009, 7]];
-line4 = [           [2007, 5],            [2009, 9]];
+line4 = [[2006, 2], [2007, 5], [2008, 4], [2009, 9]];
 
 plot3 = $.jqplot('chart', [line1, line2, line3, line4], {
-    seriesDefaults:{renderer:$.jqplot.BarRenderer},
+    seriesDefaults:{renderer:$.jqplot.BarRenderer, rendererOptions:{barPadding:10, barMargin:10}},
     legend: {show:true, location: 'nw'},
     axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}, yaxis:{min:0, max:20, numberTicks:6}}
     });

tests/barRendererTests.php

 <script>
     function runSuites() {
       var o, n, nid;
+      var h = 320;
+      var w = 480;
       
       
       nid = uID();
       plot1 = $.jqplot('_target_', [line1, line2], \
       {legend:{show:true, location:'ne'},title:'Bar Chart', \
       series:[{label:'Profits', renderer:$.jqplot.BarRenderer}, {label:'Expenses', renderer:$.jqplot.BarRenderer}], \
-      axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}});"
+      axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}, yaxis:{min:0}}});"
         
-      genplot(o);
+      genplot(o, {height:h, width:w});
       
       o = "line1 = [1,4,9, 16]; \
       line2 = [25, 12.5, 6.25, 3.125]; \
       title:'Bar Chart With Options', \
       seriesDefaults:{renderer:$.jqplot.BarRenderer, rendererOptions:{barPadding: 8, barMargin: 20}}, \
       series:[{label:'Profits'}, {label:'Expenses'}, {label:'Sales'}], \
-      axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer, ticks:['1st Qtr', '2nd Qtr', '3rd Qtr', '4th Qtr']}}});"
+      axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer, ticks:['1st Qtr', '2nd Qtr', '3rd Qtr', '4th Qtr']}, yaxis:{min:0}}});"
         
-      genplot(o);
+      genplot(o, {height:h, width:w});
       
       o = "line1 = [[1,1], [4,2], [9,3], [16,4]]; \
       line2 = [[25,1], [12.5,2], [6.25,3], [3.125,4]]; \
       plot3 = $.jqplot('_target_', [line1, line2], \
       {legend:{show:true, location:'ne'}, \
       title:'Vertically Oriented Bar Chart', \
-      seriesDefaults:{renderer:$.jqplot.BarRenderer, rendererOptions:{barDirection:'horizontal', barPadding: 6, barMargin:15}}, \
+      seriesDefaults:{renderer:$.jqplot.BarRenderer, rendererOptions:{barDirection:'horizontal', barPadding: 6, barMargin:15}, shadowAngle:135}, \
       series:[{label:'Cats'}, {label:'Dogs'}], \
-      axes:{yaxis:{renderer:$.jqplot.CategoryAxisRenderer, ticks:['Once', 'Twice', 'Three Times', 'More']}}});"
+      axes:{xaxis:{min:0}, yaxis:{renderer:$.jqplot.CategoryAxisRenderer, ticks:['Once', 'Twice', 'Three Times', 'More']}}});"
         
-      genplot(o);
+      genplot(o, {height:360, width:420});
   
       prettyPrint();
       

tests/canvasAxisTests.php

           
       nid = uID();
       
+      c = 'Rotated axis text is possible through the canvasTextRenderer and canvasAxisTickRenderer plugins.  Native text rendering with the canvas tag is supported in FireFox 3.5 and Safari 4.  In these browsers, full css font specifications are supported.  For other browsers, text is drawn on canvas using the Hershey sans-serif font metrics.'
+      
       o = "line1=[['2008-09-30', 4], ['2008-10-30', 6.5], ['2008-11-30', 5.7], ['2008-12-30', 9], ['2009-01-30', 8.2]]; \
       plot1 = $.jqplot('_target_', [line1], \
       {title:'Rotated Text with Canvas Axis', \
       tickOptions:{formatString:'%b %#d, %Y', fontSize:'10pt', fontFamily:'Tahoma', angle:-40}}}, \
       series:[{lineWidth:4, markerOptions:{style:'square'}}]});";
       
-      genplot(o, {var_space:false});
+      genplot(o, {comment: c, var_space:false});
   
       prettyPrint();
       

tests/categoryAxisTests.php

   
     function runSuites() {
       var o, n, nid;
+      var h = 340;
+      var w = 480;
       
       
       nid = uID();
       axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}, \
       series:[{lineWidth:4, markerOptions:{style:'square'}}]});";
       
-      genplot(o);
+      genplot(o, {height:h, width:w});
       
       o = "line1=[4, 25, 13, 22, 14, 17, 15]; \
       ticks = ['uno', 'dos', 'tres', 'cuatro', 'cinco', 'seis', 'siete']; \
       axes:{xaxis:{ticks:ticks, renderer:$.jqplot.CategoryAxisRenderer}}, \
       series:[{lineWidth:4, markerOptions:{style:'square'}}]});";
       
-      genplot(o);
+      genplot(o, {height:h, width:w});
       
       o = "line1=[['uno', 4], ['due', 25], ['tre', 13], ['quattro', 22], ['cinque', 14], ['sei', 17], ['sette', 15]]; \
       plot8 = $.jqplot('_target_', [line1], \
-      {title:'Customized Category X Axis by Series Data Specificaiton', \
+      {title:'Customized Category X Axis by <br />Series Data Specificaiton', \
       axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}, \
       series:[{lineWidth:4, markerOptions:{style:'square'}}]});";
       
-      genplot(o, {var_space:false});
+      genplot(o, {var_space:false, height:h, width:w});
   
       prettyPrint();
       
 <?php
-  $pages = array('coretests.php', 'pieTests.php', 'logAxisTests.php', 'dateAxisTests.php', 'categoryAxisTests.php', 'barRendererTests.php', 'datasetTests.php', 'stackedTests.php', 'canvasAxisTests.php', 'highlighterTests.php');
-  $labels = array('Core', 'Log Axes', 'Date Axes', 'Category Axes', 'Bar Plots', 'Rotated Text', 'Point Highlighter');
-      
-      $len = count($pages);
-      $parts = explode("/", $_SERVER["REQUEST_URI"]);
-      $currpage = end($parts);
-      $curridx = array_search($currpage, $pages);
-      $prevpage = $pages[$curridx - 1];
-      if (!$prevpage) $prevpage = $pages[$len-1];
-      $nextpage = $pages[$curridx + 1];
-      if (!$nextpage) $nextpage = $pages[0];
-      
-      $currlabel = $labels[$curridx];
-      $prevlabel = $labels[$curridx - 1];
-      $nextlabel = $labels[$curridx + 1];
-      
-      $a = '<a href="%s">';
+  $pages = array('coretests.php', 'pieTests.php', 'logAxisTests.php', 'dateAxisTests.php', 'categoryAxisTests.php', 'barRendererTests.php', 'dragableTests.php', 'stackedTests.php', 'canvasAxisTests.php', 'highlighterTests.php');
+        
+  $len = count($pages);
+  $parts = explode("/", $_SERVER["REQUEST_URI"]);
+  $currpage = end($parts);
+  $curridx = array_search($currpage, $pages);
+  $prevpage = $pages[$curridx - 1];
+  if (!$prevpage) $prevpage = $pages[$len-1];
+  $nextpage = $pages[$curridx + 1];
+  if (!$nextpage) $nextpage = $pages[0];
+  
+  $a = '<a href="%s">';
 ?>
 
 </head>

tests/dateAxisTests.php

   
     function runSuites() {
       var o, n, nid;
+      var h = 320;
+      var w = 540;
           
       nid = uID();
       
+      c = 'Date axes support is provided through the dateAxisRenderer plugin.  Date axes expand javascripts native date handling capabilities.  This allow dates to be input in almost any unambiguous form, not just in milliseconds!'
+      
       o = "line1=[['2008-09-30', 4], ['2008-10-30', 6.5], ['2008-11-30', 5.7], ['2008-12-30', 9], ['2009-01-30', 8.2]]; \
       plot9 = $.jqplot('_target_', [line1], \
       {title:'Default Date Axis', \
       axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}, \
       series:[{lineWidth:4, markerOptions:{style:'square'}}]});";
       
-      genplot(o, {var_space:false});
+      genplot(o, {var_space:false, height:h, width:w, comment:c});
+      
+      c = "Date Axes also provide powerful formatting features.  This allows custom formatter strings to be used to format axis tick labels precisely the way you want."
       
       o = "line1=[['2008-06-30', 4], ['2008-7-30', 6.5], ['2008-8-30', 5.7], ['2008-9-30', 9], ['2008-10-30', 8.2]]; \
       plot10 = $.jqplot('_target_', [line1], \
-      {title:'Customized Date Axis', gridPadding:{right:45}, \
+      {title:'Customized Date Axis', gridPadding:{right:35}, \
       axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer, tickOptions:{formatString:'%b %#d, %y'}, min:'May 30, 2008', tickInterval:'1 month'}}, \
       series:[{lineWidth:4, markerOptions:{style:'square'}}]});";
       
-      genplot(o, {var_space:false});
+      genplot(o, {var_space:false, height:h, width:w, comment: c});
   
       prettyPrint();
       

tests/dragableTests.js

+describe 'jqPlot Dragable Plugin'
+    it plot1.title.text
+        plot1.axes.xaxis.should.have_property '_elem'
+        plot1.seriesCanvas.should.have_property '_elem'
+    end
+end

tests/dragableTests.php

+<?php
+  $title = "jqPlot Dragable and Trend Line Plugins";
+  $jspec_title = "jqPlot Dragable and Trend Line Tests and Examples";
+  $jqplot_js_includes = array();
+  $jqplot_js_includes[] = "../src/plugins/jqplot.dragable.js";
+  $jqplot_js_includes[] = "../src/plugins/jqplot.trendline.js";
+  require("opener.php");
+?>
+  <script language="javascript" type="text/javascript">
+
+  
+    function runSuites() {
+      var o, n, nid;
+      
+      
+      nid = uID();
+      
+      c = "The dragable plugin allows you to mouse over a data point, drag it, and drop it somewhere else on the plot.  It automatically redraws the series after the point is dragged and dropped.  The underlying plot data is updated as well.<p>The trend line plugin automatically computes a linear regression trend line of the series data.  The trend line is automatically recalculated as data is changed.  So when you drag and drop a point, the trend line updates.<p>Plugins like dragable and trendline don't require any additional options to be set.  Just include the plugin file in your source and they're active!"
+      
+      o = "line1=[4, 25, 13, 22, 14, 17, 15]; \
+      plot1 = $.jqplot('_target_', [line1], \
+      {title:'Dragable and Trend Line Example'});";
+      
+      genplot(o, {comment:c, height:320, width:480});
+  
+      prettyPrint();
+      
+      JSpec.options.profile = false;
+      JSpec
+      .exec('dragableTests.js')
+      .run()
+      .report()
+    }
+  </script>
+
+<?php
+  require('closer.php');
+?>

tests/highlighterTests.php

 <?php
-  $title = "jqPlot Data Point and Cursor Highlighter Tests";
-  $jspec_title = "jqPlot Data Point and Cursor Highlighter Plugin Tests and Examples";
+  $title = "jqPlot Highlighter and Cursor Plugin Tests";
+  $jspec_title = "jqPlot Data Point Highlighter and Cursor Tracking Plugin Tests and Examples";
   $jqplot_js_includes = array();
   $jqplot_js_includes[] = "../src/plugins/jqplot.dateAxisRenderer.js";
   $jqplot_js_includes[] = "../src/plugins/jqplot.canvasTextRenderer.js";
       c ='The Cursor plugin changes the mouse cursor when it enters the graph area and displays an optional tooltip with the mouse position.  The tooltip can be in a fixed location, or it can follow the mouse.  The pointer style, set to "crosshair" by default, can also be customized.  Tooltip values are formatted similar to the Highlighter plugin.  By default they use the axes formatters, but can be customized with a sprintf format string.';
       
       o = "plot2 = $.jqplot('_target_', [line1], \
-      {title:'Cursor Highlighting', \
+      {title:'Mouse Cursor Tracking', \
       axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer, \
       rendererOptions:{tickRenderer:$.jqplot.CanvasAxisTickRenderer}, \
       tickOptions:{formatString:'%b %#d, %Y', fontSize:'10pt', fontFamily:'Tahoma', angle:-30}}, \
               <tr class="description"><td><a href="dateAxisTests.php">Date Axes</a></td></tr>
               <tr class="description"><td><a href="categoryAxisTests.php">Category Axes</a></td></tr>
               <tr class="description"><td><a href="barRendererTests.php">Bar Charts</a></td></tr>
-              <tr class="description"><td><a href="datasetTests.php">Single point and flat line data set tests.</a></td></tr>
+              <tr class="description"><td><a href="dragableTests.php">Drag and Drop and Trend Lines</a></td></tr>
               <tr class="description"><td><a href="stackedTests.php">Stacked Bar and Line Charts</a></td></tr>
               <tr class="description"><td><a href="canvasAxisTests.php">Rotated Axis Text</a></td></tr>
               <tr class="description"><td><a href="highlighterTests.php">Data Point Highlighter</a></td></tr>

tests/logAxisTests.js

         plot1.seriesCanvas.should.have_property '_elem'
         plot1.axes.yaxis.renderer.constructor.should.equal $.jqplot.LogAxisRenderer
         plot1.axes.yaxis.base.should.equal 10
-        plot1.legend.location.should.be 'e'
+        plot1.legend.location.should.be 'ne'
         plot1.axes.xaxis.min.should.be 0
         plot1.axes.xaxis.max.should.be 5
         plot1.axes.yaxis.tickDistribution.should.be 'power'

tests/logAxisTests.php

   
     function runSuites() {
       var o, n, nid;
+      var h = 320;
+      var w = 480;
       
       
       nid = uID();
+      
+      c = 'Support for logarithmic axes is provided through the logAxisRenderer plugin.  By default, ticks are displayed with an even visual spacing.  This can also be achieved by setting the "tickDistribution" option to "even".'
+
+      o = "line2 = [25, 12.5, 6.25, 3.125]; \
+      plot4 = $.jqplot('_target_', [line2], { \
+      legend:{show:true, location:'ne'}, \
+      title:'Log Y Axis, Even Tick Distribution', \
+      series:[{label:'Declining line'}], \
+      axes:{xaxis:{min:0, max:5}, yaxis:{min:1, max:64, renderer:$.jqplot.LogAxisRenderer}}});"
+        
+      genplot(o, {height:h, width:w, comment:c});
+      
+      c = 'Log axes can also display ticks in a traditional manner, with marks at every power of the log base and sub divisions between as appropriate.  This is achieved by setting the "tickDistribution" option to "power".'
 
       o = "line2 = [25, 12.5, 6.25, 3.125]; \
       plot1 = $.jqplot('_target_', [line2], { \
-      legend:{show:true, location:'e'}, \
+      legend:{show:true, location:'ne'}, \
       title:'Log Y Axis, Power Tick Distribution', \
       series:[{label:'Declining line'}], \
       axes:{xaxis:{min:0, max:5}, yaxis:{tickDistribution:'power', renderer:$.jqplot.LogAxisRenderer}}});"
         
-      genplot(o);
+      genplot(o, {height:h, width:w, comment:c});
+      
+      c = 'A ticks array can also be specified in a ticks array, to give the exact ticks desired.  The renderer will handle placing them at the appropriate positions on the plot.'
 
       o = "line2 = [25, 12.5, 6.25, 3.125]; \
       plot2 = $.jqplot('_target_', [line2], { \
-      legend:{show:true, location:'e'}, \
+      legend:{show:true, location:'ne'}, \
       title:'Log Y Axis, Specifying Tick Values', \
       series:[{label:'Declining line'}], \
       axes:{xaxis:{min:0, max:5}, yaxis:{renderer:$.jqplot.LogAxisRenderer, ticks:[1, 2, 4, 8, 16, 32, 64]}}});"
         
-      genplot(o);
+      genplot(o, {height:h, width:w, comment:c});
+      
+      c = 'Plots support dual axes as well.  Here is a plot with a normal primary y axis and a logarithmic secondary axis.  For dual axes, the plot tries to provide an equal number of ticks per axis to so marks fall at the same position on the grid for both primary and secondary axes.'
       
       o = "line1 = [[1,1],[2,4],[3,9],[4,16]]; \
       line2 = [25, 12.5, 6.25, 3.125]; \
       plot3 = $.jqplot('_target_', [line1, line2], \
-      {legend:{show:true, location:'e'},title:'Secondary Log Axis, Even Tick Distribution, Specify Min/Max', \
+      {legend:{show:true, location:'e'},title:'Secondary Log Axis, Even Tick Distribution,<br /> Specify Min/Max', \
       series:[{label:'Rising line'},{yaxis:'y2axis', label:'Declining line'}], \
       axes:{xaxis:{min:0, max:5}, y2axis:{renderer:$.jqplot.LogAxisRenderer, min:2, max:30}}});"
         
-      genplot(o);
+      genplot(o, {height:h, width:w, comment:c});
   
       prettyPrint();
       

tests/pieTests.js

+describe 'jqPlot Pie Charts'
+    it plot1.title.text
+        plot1.seriesCanvas.should.have_property '_elem'
+    end
+    it plot2.title.text
+        plot2.seriesCanvas.should.have_property '_elem'
+    end
+    it plot3.title.text
+        plot3.seriesCanvas.should.have_property '_elem'
+    end
+end

tests/pieTests.php

+<?php
+  $title = "jqPlot Pie Charts";
+  $jspec_title = "jqPlot Pie Chart Tests and Examples";
+  $jqplot_js_includes = array();
+  $jqplot_js_includes[] = "../src/plugins/jqplot.pieRenderer.js";
+  require("opener.php");
+?>
+  <script language="javascript" type="text/javascript">
+
+  
+    function runSuites() {
+      var o, n, nid;
+      
+      
+      nid = uID();
+      
+      c = "The default pie chart automatically sizes itself (with a customizable margin) and centers itself in the plot area.";
+      
+      o = "line1 = [['frogs', 3], ['buzzards', 7], ['deer', 2.5], ['turkeys', 6], ['moles', 5], ['ground hogs', 4]];\
+      plot1 = $.jqplot('_target_', [line1], {\
+        title: 'Default Pie Chart',\
+        seriesDefaults:{renderer:$.jqplot.PieRenderer}\
+      });";
+      
+      genplot(o, {comment:c, height:320, width:420, var_space:false});
+      
+      c = 'By changing the "sliceMargin" property (default 0), you can "explode" the pie chart into separate slices.  The chart is again automatically sized and positioned to fit into the plot area and account for the legend.';
+      
+      o = "plot2 = $.jqplot('_target_', [line1], {\
+        title: 'Pie Chart with Legend and sliceMargin',\
+        seriesDefaults:{renderer:$.jqplot.PieRenderer, rendererOptions:{sliceMargin:8}}, \
+        legend:{show:true}\
+      });";
+      
+      genplot(o, {comment: c, height:320, width:460});
+      
+      c = 'Want all the pie taste with less filling?  By setting the "fill:false" option, slices will be stroked but not filled.  You can control the line width of the slices and the margin between slices.';
+      
+      o = "plot3 = $.jqplot('_target_', [line1], {\
+        title: 'Pie Chart without the Filling',\
+        seriesDefaults:{renderer:$.jqplot.PieRenderer, rendererOptions:{sliceMargin:8, fill:false, shadow:false, lineWidth:5}}, \
+        legend:{show:true, location: 'w'}\
+      });";
+      
+      genplot(o, {comment:c, height:300, width:460});
+      
+      c = 'Still too many calories?  You can specify a smaller pie by manually setting the "diameter" property.';
+      
+      o = "plot4 = $.jqplot('_target_', [line1], {\
+        title: 'Small Pie Chart',\
+        seriesDefaults:{renderer:$.jqplot.PieRenderer, rendererOptions:{sliceMargin:8, fill:false, shadow:false, lineWidth:5, diameter:100}}, \
+        legend:{show:true, location: 'w'}\
+      });";
+      
+      genplot(o, {comment:c, height:300, width:460});
+      
+      prettyPrint();
+      
+      JSpec.options.profile = false;
+      JSpec
+      .exec('pieTests.js')
+      .run()
+      .report()
+    }
+  </script>
+
+<?php
+  require('closer.php');
+?>

tests/stackedTests.php

       line2 = [[3, 1], [7, 2], [6.25, 3], [3.125, 4]];\
       plot2 = $.jqplot('_target_', [line1, line2], {stackSeries: true, legend: {show: true, location: 'se'},\
       title: 'Unit Sales: Acme Decoy Division',\
-      seriesDefaults: {renderer: $.jqplot.BarRenderer, \
+      seriesDefaults: {renderer: $.jqplot.BarRenderer, shadowAngle: 135, \
         rendererOptions: {\
             barDirection: 'horizontal', barWidth: 40}},\
       series: [{label: 'Noisy'}, {label: 'Quiet'}],\
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.