[FIX] overlapping graphs in dashboard
lp bug: https://launchpad.net/bugs/854692 fixed bzr revid: xmo@openerp.com-20110926112525-h596n82mqw5ol4bx
This commit is contained in:
commit
ebf51467e9
|
@ -49,8 +49,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
||||||
this.operator = [];
|
this.operator = [];
|
||||||
this.group_field = [];
|
this.group_field = [];
|
||||||
this.orientation = this.fields_view.arch.attrs.orientation || '';
|
this.orientation = this.fields_view.arch.attrs.orientation || '';
|
||||||
this.elem_id = this.$element[0]['id'];
|
|
||||||
|
|
||||||
_.each(this.fields_view.arch.children, function (field) {
|
_.each(this.fields_view.arch.children, function (field) {
|
||||||
if (field.attrs.operator) {
|
if (field.attrs.operator) {
|
||||||
this.operator.push(field.attrs.name);
|
this.operator.push(field.attrs.name);
|
||||||
|
@ -98,7 +96,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
schedule_chart: function(results) {
|
schedule_chart: function(results) {
|
||||||
this.$element.html(QWeb.render("GraphView", {"fields_view": this.fields_view, "chart": this.chart,'elem_id': this.elem_id}));
|
this.$element.html(QWeb.render("GraphView", {"fields_view": this.fields_view, "chart": this.chart,'element_id': this.element_id}));
|
||||||
|
|
||||||
_.each(results, function (result) {
|
_.each(results, function (result) {
|
||||||
_.each(result, function (field_value, field_name) {
|
_.each(result, function (field_value, field_name) {
|
||||||
|
@ -304,7 +302,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
||||||
|
|
||||||
var bar_chart = new dhtmlXChart({
|
var bar_chart = new dhtmlXChart({
|
||||||
view: view_chart,
|
view: view_chart,
|
||||||
container: self.elem_id+"-barchart",
|
container: self.element_id+"-barchart",
|
||||||
value:"#"+group_list[0]+"#",
|
value:"#"+group_list[0]+"#",
|
||||||
gradient: "3d",
|
gradient: "3d",
|
||||||
border: false,
|
border: false,
|
||||||
|
@ -374,7 +372,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
bar_chart.parse(_.values(abscissa_data), "json");
|
bar_chart.parse(_.values(abscissa_data), "json");
|
||||||
jQuery("#"+self.elem_id+"-barchart").height(jQuery("#"+self.elem_id+"-barchart").height()+50);
|
jQuery("#"+self.element_id+"-barchart").height(jQuery("#"+self.element_id+"-barchart").height()+50);
|
||||||
bar_chart.attachEvent("onItemClick", function(id) {
|
bar_chart.attachEvent("onItemClick", function(id) {
|
||||||
self.open_list_view(bar_chart.get(id));
|
self.open_list_view(bar_chart.get(id));
|
||||||
});
|
});
|
||||||
|
@ -383,7 +381,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
||||||
var self = this;
|
var self = this;
|
||||||
var chart = new dhtmlXChart({
|
var chart = new dhtmlXChart({
|
||||||
view:"pie3D",
|
view:"pie3D",
|
||||||
container:self.elem_id+"-piechart",
|
container:self.element_id+"-piechart",
|
||||||
value:"#"+self.operator_field+"#",
|
value:"#"+self.operator_field+"#",
|
||||||
pieInnerText:function(obj) {
|
pieInnerText:function(obj) {
|
||||||
var sum = chart.sum("#"+self.operator_field+"#");
|
var sum = chart.sum("#"+self.operator_field+"#");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<div t-name="GraphView" t-att-id="elem_id+'-'+chart+'chart'"
|
<div t-name="GraphView" t-att-id="element_id+'-'+chart+'chart'"
|
||||||
style="height:300px;position:relative;"/>
|
style="height:300px;position:relative;"/>
|
||||||
</template>
|
</template>
|
Loading…
Reference in New Issue