diff --git a/public/app/plugins/panel/graph2/GraphPanel.tsx b/public/app/plugins/panel/graph2/GraphPanel.tsx index 99893631eb7..5d3bdca5dca 100644 --- a/public/app/plugins/panel/graph2/GraphPanel.tsx +++ b/public/app/plugins/panel/graph2/GraphPanel.tsx @@ -24,23 +24,25 @@ export class GraphPanel extends PureComponent { const vmSeries: TimeSeriesVMs = []; for (const table of data) { const timeColumn = getFirstTimeColumn(table); - if (timeColumn >= 0) { - for (let i = 0; i < table.columns.length; i++) { - const column = table.columns[i]; + if (timeColumn < 0) { + continue; + } - // Show all numeric columns - if (column.type === ColumnType.number) { - const tsvm = processTimeSeries({ - data: [table], - xColumn: timeColumn, - yColumn: i, - nullValueMode: NullValueMode.Null, - })[0]; + for (let i = 0; i < table.columns.length; i++) { + const column = table.columns[i]; - const colorIndex = vmSeries.length % colors.length; - tsvm.color = colors[colorIndex]; - vmSeries.push(tsvm); - } + // Show all numeric columns + if (column.type === ColumnType.number) { + const tsvm = processTimeSeries({ + data: [table], + xColumn: timeColumn, + yColumn: i, + nullValueMode: NullValueMode.Null, + })[0]; + + const colorIndex = vmSeries.length % colors.length; + tsvm.color = colors[colorIndex]; + vmSeries.push(tsvm); } } }