Commit fa813024 by Torkel Ödegaard

SingleStatPanel: various fixes

parent 37176fa4
......@@ -169,7 +169,9 @@ function (angular, app, _, TimeSeries, kbn) {
var data = {};
if (!$scope.series || $scope.series.length === 0) {
data.series = { mainValue: null, datapoints: [] };
data.flotpairs = [];
data.mainValue = Number.NaN;
data.mainValueFormated = 'NaN';
}
else {
var series = $scope.series[0];
......
......@@ -21,14 +21,6 @@ function (angular, app, _, kbn, $) {
var $panelContainer = elem.parents('.panel-container');
scope.$on('render', function() {
data = scope.data;
panel = scope.panel;
if (!data || data.flotpairs.length === 0) {
elem.html('no data');
return;
}
render();
});
......@@ -148,9 +140,11 @@ function (angular, app, _, kbn, $) {
}
function render() {
data = scope.data;
panel = scope.panel;
setElementHeight();
var panel = scope.panel;
var body = getBigValueHtml();
if (panel.colorBackground && data.mainValue) {
......
......@@ -99,10 +99,15 @@ function (angular, $, kbn, _, moment) {
result.panel = panel;
result.row = row;
result.index = index;
return;
}
});
});
if (!result.panel) {
return null;
}
return result;
};
......
......@@ -39,7 +39,9 @@ function (angular, _, $) {
if (!this.state.panelId) { return; }
var panelInfo = this.$scope.dashboard.getPanelInfoById(this.state.panelId);
panelInfo.row.collapse = false;
if (panelInfo) {
panelInfo.row.collapse = false;
}
};
DashboardViewState.prototype.needsSync = function(urlState) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment