Commits

Henrik Kirk  committed c470cb5

Fixed performance issue when drawing pointlabels with zeros/null values

  • Participants
  • Parent commits dd65cd0

Comments (0)

Files changed (1)

File src/plugins/jqplot.pointLabels.js

             for (var i=0, l=p._labels.length; i < l; i++) {
                 var label = p._labels[i];
                 
-                if (p.hideZeros && parseInt(p._labels[i], 10) == 0) {
-                    label = '';
+                if (label == null || (p.hideZeros && parseInt(label, 10) == 0)) {
+                    continue;
                 }
                 
-                if (label != null) {
-                    label = p.formatter(p.formatString, label);
-                } 
+                label = p.formatter(p.formatString, label);
 
                 helem = document.createElement('div');
                 p._elems[i] = $(helem);