fix #8056 - more refinements to checking data
[g.raphael] / g.raphael.0.51.js
index 3de123c..a871140 100644 (file)
@@ -844,14 +844,22 @@ Raphael.g = {
                 dx = (length - (opts.loffset + opts.roffset)) / steps,
                 txt = 0,
                 prev = 0;
-
+        
+            if(dx < 1){
+                dx = 1;
+            }
+        
             while (X <= x + length) {
                 Roo.log('label ' + j + ":" + labels[j]);
+                
                 if (typeof(labels[j]) == 'undefined') {
+                    label += d;
+                    X += dx;
                     continue;
                 }
-                
+                // add the line
                 type != "-" && type != " " && (path = path.concat(["M", X + .5, y - (type == "+" ? dashsize : !!orientation * dashsize * 2), "l", 0, dashsize * 2 + 1]));
+                // add the text...
                 text.push(txt = paper.text(X, y + addon, (labels && labels[j++]) || (Math.round(label) == label ? label : +label.toFixed(rnd))).attr(txtattr));
 
                 var bb = txt.getBBox();