From dfccabab75ae6d99ba5057f4dc2c8598b697760c Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Thu, 5 Apr 2018 20:59:11 +0200 Subject: [PATCH] singlestat: Fix optimization in setTableColumnToSensibleDefault tableColumnOptions is an associative array that has no property length. Use tableData.columns as in the default case which works just fine. --- public/app/plugins/panel/singlestat/module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index 776033536dd..c7f523a9591 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -159,8 +159,8 @@ class SingleStatCtrl extends MetricsPanelCtrl { } setTableColumnToSensibleDefault(tableData) { - if (this.tableColumnOptions.length === 1) { - this.panel.tableColumn = this.tableColumnOptions[0]; + if (tableData.columns.length === 1) { + this.panel.tableColumn = tableData.columns[0].text; } else { this.panel.tableColumn = _.find(tableData.columns, col => { return col.type !== 'time';