Commits

Chris Leonello committed 816e2ab

Added escapeHtml option to title so can include html tags in title if needed.
Added doc for legend escapeHtml option.

Comments (0)

Files changed (3)

src/jqplot.core.js

         // CSS style for the margin which will override any style sheet setting.
         // The default will be taken from the stylesheet.
         this.marginLeft = null;
-        
+        // prop: escapeHtml
+        // True to escape special characters with their html entity equivalents
+        // in legend text.  "<" becomes &lt; and so on, so html tags are not rendered.
         this.escapeHtml = false;
         this._series = [];
         
         // prop: rendererOptions
         // renderer specific options passed to the renderer.
         this.rendererOptions = {};   
+        // prop: escapeHtml
+        // True to escape special characters with their html entity equivalents
+        // in title text.  "<" becomes &lt; and so on, so html tags are not rendered.
+        this.escapeHtml = false;
     }
     
     Title.prototype = new $.jqplot.ElemContainer();

src/jqplot.divTitleRenderer.js

             if (this.fontSize) {
                 styles['fontSize'] = this.fontSize;
             }
-            if (this.textAlign) {
+            if (typeof this.textAlign === 'string') {
                 styles['textAlign'] = this.textAlign;
             }
             else {
             }
 
             this._elem.css(styles);
-            this._elem.text(this.text);
+            if (this.escapeHtml) {
+                this._elem.text(this.text);
+            }
+            else {
+                this._elem.html(this.text);
+            }
 
 
             // styletext += (this._plotWidth) ? 'width:'+this._plotWidth+'px;' : '';

src/plugins/jqplot.pyramidRenderer.js

 
     // if bar renderer is not loaded, load it since pyramid is subclass of bar.
     // 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.BarRenderer === undefined) {
+    //     $.ajax({
+    //         url: $.jqplot.pluginLocation + 'jqplot.barRenderer.js',
+    //         dataType: "script",
+    //         async: false
+    //     });
+    // }
 
     $.jqplot.PyramidRenderer = function(){
-        $.jqplot.BarRenderer.call(this);
+        $.jqplot.LineRenderer.call(this);
     };
     
-    $.jqplot.PyramidRenderer.prototype = new $.jqplot.BarRenderer();
+    $.jqplot.PyramidRenderer.prototype = new $.jqplot.LineRenderer();
     $.jqplot.PyramidRenderer.prototype.constructor = $.jqplot.PyramidRenderer;
     
     // called with scope of a series