[FIX] web: prevent crash in line chart with 1 record

Since commit 8625242884, the graph view crashed when
displaying a line chart with only one record.  The reason is that the
method display_line can return undefined (if no line chart can be
displayed).  In that case, there is no reasy to try to display its
tooltip.

This commit simply protect against the case where it is undefined.
This commit is contained in:
Géry Debongnie
2016-12-08 10:11:24 +01:00
parent 2ab85a0783
commit 44c1fa7138
@@ -99,7 +99,9 @@ return Widget.extend({
}));
} else {
var chart = this['display_' + this.mode]();
chart.tooltip.chartContainer(this.$el[0]);
if (chart) {
chart.tooltip.chartContainer(this.$el[0]);
}
}
},
display_bar: function () {