summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph.js
diff options
context:
space:
mode:
authorBhumi Thakkar (Open ERP) <bth@tinyerp.com>2012-09-11 13:45:59 +0530
committerBhumi Thakkar (Open ERP) <bth@tinyerp.com>2012-09-11 13:45:59 +0530
commit3acafeadbc7366118d07174984cc7ef20de3e7d2 (patch)
tree77f952af99f8abb7ac4dc0e036cb0c492cf95c45 /addons/web_graph/static/src/js/graph.js
parent8126882b0ea69504976b27ff70032341a1cf9a93 (diff)
parent75de060cd836578962788a61c4a2728aedd95d80 (diff)
[IMP] Improve code check record length.
bzr revid: bth@tinyerp.com-20120911081559-3c6ll9ab1mvk3u07
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
-rw-r--r--addons/web_graph/static/src/js/graph.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index b3fef54d094..b82b1521e87 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -142,9 +142,11 @@ instance.web_graph.GraphView = instance.web.View.extend({
options_bar: function (data) {
var min = _(data.data).chain()
.map(function (record) {
- return _.min(record.data, function (item) {
- return item[1];
- })[1];
+ if (record.data.length > 0){
+ return _.min(record.data, function (item) {
+ return item[1];
+ })[1];
+ }
}).min().value();
return {
bars : {