Kunal Chavda (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-889731-kch into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
  Bug #889731 in OpenERP Web: "graph - missing bars"
  https://bugs.launchpad.net/openerp-web/+bug/889731

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-889731-kch/+merge/82971

Hello,
I have coded for showing stackbar chart. when there is key with slash and 
trying to find its value from object result it will not work because 
dhtmlxchart library not support forward slash or backward slash.

Thanks,
Kunal Chavda(kch).
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-889731-kch/+merge/82971
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-889731-kch.
=== modified file 'addons/web_graph/static/src/js/graph.js'
--- addons/web_graph/static/src/js/graph.js	2011-11-15 12:30:59 +0000
+++ addons/web_graph/static/src/js/graph.js	2011-11-22 05:05:24 +0000
@@ -187,7 +187,6 @@
 
     schedule_bar: function(results) {
         var self = this;
-
         var group_list, view_chart;
         if (!this.group_field) {
             view_chart = (this.orientation === 'horizontal') ? 'barH' : 'bar';
@@ -220,7 +219,7 @@
                     .map(function (value, index) {
                         return {
                             group: self.ordinate + '_' +
-                                    value.toLowerCase().replace(/\s/g, '_'),
+                                    value.toLowerCase().replace(/[\s\/]+/g,'_'),
                             text: value,
                             color: COLOR_PALETTE[index % COLOR_PALETTE.length]
                         };
@@ -235,21 +234,19 @@
                     _(records).each(function (record) {
                         var key = _.str.sprintf('%s_%s',
                             self.ordinate,
-                            record[self.group_field].toLowerCase().replace(/\s/g, '_'));
+                            record[self.group_field].toLowerCase().replace(/[\s\/]+/g,'_'));
                         r[key] = record[self.ordinate];
                     });
                     return r;
                 })
                 .value();
         }
-
         var abscissa_description = {
             title: "<b>" + this.fields[this.abscissa].string + "</b>",
             template: function (obj) {
                 return obj[self.abscissa] || 'Undefined';
             }
         };
-
         var ordinate_description = {
             lines: true,
             title: "<b>" + this.fields[this.ordinate].string + "</b>"
@@ -263,7 +260,6 @@
             x_axis = abscissa_description;
             y_axis = ordinate_description;
         }
-
         var renderer = function () {
             if (self.$element.is(':hidden')) {
                 self.renderer = setTimeout(renderer, 100);

_______________________________________________
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