[FIX] Fixed the issue when we change graph type than its generate the error.

bzr revid: jra@tinyerp.com-20120914085814-9ynqj8dxrd4pp4lz
This commit is contained in:
Jiten (OpenERP)
2012-09-14 14:28:14 +05:30
+5 -3
View File
@@ -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 : {