Fix #5861 - Post release report
authorEdward <edward@roojs.com>
Wed, 24 Apr 2019 06:59:24 +0000 (14:59 +0800)
committerEdward <edward@roojs.com>
Wed, 24 Apr 2019 06:59:24 +0000 (14:59 +0800)
g.bar.overlay.js

index d61c217..feb3280 100644 (file)
@@ -145,10 +145,12 @@ if (typeof(Raphael) == 'undefined') {
                     indicator_y = y + opts.legendheight - 42;
                 }
                 
-                paper.rect(x + 1 + (k * barwidth) + 8 , indicator_y, barwidth - 16, 30, 5).attr({ stroke: "none", fill: colors[i%colors.length] });
+                var fontSize = barsteps > 10 ? 10 : 16;
+                
+                paper.rect(x + 1 + (k * barwidth) + 5 , indicator_y, barwidth - 10, 30, 5).attr({ stroke: "none", fill: colors[i%colors.length] });
                 paper.path(["M", x + 1 + (k * barwidth) + barwidth / 4 + 10, indicator_y + 30, "l", 5, 10, "l", 5, -10]).attr({ stroke: "none", fill: colors[i%colors.length] });
                 paper.text(x + 1 + (k * barwidth) + barwidth / 2, indicator_y + 14, Roo.util.Format.number(v, 0)).attr({ 
-                    "font-size": "16",
+                    "font-size": fontSize,
                     "font-family": "'Fontin Sans', Fontin-Sans, sans-serif",
                     "font-weight": "bold",
                     fill : "#fff"
@@ -168,6 +170,7 @@ if (typeof(Raphael) == 'undefined') {
                 max,
                 opts.axisystep || 10,
                 opts.asixywidth,
+                barsteps,
                 paper
             )
         );
@@ -201,10 +204,10 @@ if (typeof(Raphael) == 'undefined') {
         return new MVBarchart(this, x, y, width, height, values, opts);
     };
     
-    MVBarchart.prototype.rightAxis = function (x, y, length, max, steps, asixxheight, paper)
+    MVBarchart.prototype.rightAxis = function (x, y, length, max, steps, asixywidth, barsteps, paper)
     {
 //        Roo.log('Right Axis');
-//        Roo.log([x, y, length, max, steps, ewidth]);
+//        Roo.log([x, y, length, max, steps, asixywidth]);
         
         var path = [],
             color = "#bababa",
@@ -219,14 +222,14 @@ if (typeof(Raphael) == 'undefined') {
         for(var i = 0; i <= steps; i++) {
             
             if(i != 0) {
-                paper.text(x + (asixxheight / 2), Y + 15, label).attr({ 
-                    "font-size": "20",
+                paper.text(x + (asixywidth / 2), Y + 15, label).attr({ 
+                    "font-size": (barsteps > 10) ? "14" : "20",
                     "font-family": "'Fontin Sans', Fontin-Sans, sans-serif",
                     "font-weight": "bold",
                     "text-anchor": "end",
                     fill : color
                 });
-                path = path.concat(["M", x, Y, "l", (asixxheight / 2), 0]);
+                path = path.concat(["M", x, Y, "l", (asixywidth / 2), 0]);
                 
             }
             
@@ -258,7 +261,7 @@ if (typeof(Raphael) == 'undefined') {
     
         labels.forEach(function(v,k)  {
             paper.text(x + (k * barwidth) + offset, y + (eheight / 2), v).attr({ 
-                "font-size": "20",
+                "font-size": (steps > 10) ? "16" : "20",
                 "font-family": "'Fontin Sans', Fontin-Sans, sans-serif",
                 "font-weight": "bold",
                 fill : color