Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/6.1-opw-580435-msh into lp:openerp-web/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-580435-msh/+merge/129619

Hello,

Fixed the issue of y-axis padding in graph view, here we have static 75 left 
padding it might be possible that value on y-axis might be larger so value will 
cross the y-axis line and graph looks bit ugly(Usability wise).

Demo :- Open any graph view which has larger value on y-axis like value with 8 
or 10 digit, it will cross y-axis line.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-580435-msh/+merge/129619
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/6.1-opw-580435-msh.
=== modified file 'addons/web_graph/static/src/js/graph.js'
--- addons/web_graph/static/src/js/graph.js	2012-08-31 10:32:55 +0000
+++ addons/web_graph/static/src/js/graph.js	2012-10-15 08:42:22 +0000
@@ -264,6 +264,10 @@
             x_axis = abscissa_description;
             y_axis = ordinate_description;
         }
+        var leftPadding = _.max(results, function(result){
+                return result[group_list[0].group];
+        });
+        leftPadding = parseInt(leftPadding[group_list[0].group]).toString().length * 10;
         var renderer = function () {
             if (self.$element.is(':hidden')) {
                 self.renderer = setTimeout(renderer, 100);
@@ -296,7 +300,7 @@
                 xAxis: x_axis,
                 yAxis: y_axis,
                 padding: {
-                    left: 75
+                    left: leftPadding ? Math.max(leftPadding, 75) : 75
                 },
                 legend: {
                     values: group_list,

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to