Commits

Chris Leonello committed 9fa1508

Added automatic loading of jqplot.pyramidAxisRenderer.js and jqplot.pyramidGridRenderer.js
although these should be manually loaded by the user for better caching and performance.

Comments (0)

Files changed (1)

src/plugins/jqplot.pyramidRenderer.js

  */
 (function($) {
 
-    // if bar renderer is not loaded, load it since pyramid is subclass of bar.
+    // Need to ensure pyramid axis and grid renderers are loaded.
+    // You should load these with script tags in the html head, that is more efficient
+    // as the browser will cache the request.
     // Note, have to block with synchronous request in order to execute bar renderer code.
-    // if ($.jqplot.BarRenderer === undefined) {
-    //     $.ajax({
-    //         url: $.jqplot.pluginLocation + 'jqplot.barRenderer.js',
-    //         dataType: "script",
-    //         async: false
-    //     });
-    // }
+    if ($.jqplot.PyramidAxisRenderer === undefined) {
+        $.ajax({
+            url: $.jqplot.pluginLocation + 'jqplot.pyramidAxisRenderer.js',
+            dataType: "script",
+            async: false
+        });
+    }
+    
+    if ($.jqplot.PyramidGridRenderer === undefined) {
+        $.ajax({
+            url: $.jqplot.pluginLocation + 'jqplot.pyramidGridRenderer.js',
+            dataType: "script",
+            async: false
+        });
+    }
 
     $.jqplot.PyramidRenderer = function(){
         $.jqplot.LineRenderer.call(this);
         if (setopts) {
             options.axesDefaults.renderer = $.jqplot.PyramidAxisRenderer;
             options.grid.renderer = $.jqplot.PyramidGridRenderer;
-            options.legend.show = false;
             options.seriesDefaults.pointLabels = {show: false};
         }
     }