From 92bc253cf73c3cb6d23a872ade59337b5190fae1 Mon Sep 17 00:00:00 2001 From: AlexFsmn Date: Mon, 20 Aug 2018 21:01:00 +0200 Subject: [PATCH] Fixed problem where vertical charts didn't display labels correctly. (#2263) #2017 --- src/sql/parts/grid/views/query/chartViewer.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sql/parts/grid/views/query/chartViewer.component.ts b/src/sql/parts/grid/views/query/chartViewer.component.ts index 30b9b22e54..21cccac35e 100644 --- a/src/sql/parts/grid/views/query/chartViewer.component.ts +++ b/src/sql/parts/grid/views/query/chartViewer.component.ts @@ -325,9 +325,11 @@ export class ChartViewerComponent implements OnInit, OnDestroy, IChartViewAction @Input() set dataSet(dataSet: IGridDataSet) { // Setup the execute result this._executeResult = {}; - this._executeResult.columns = dataSet.columnDefinitions.map(def => def.name); + + // Remove first column and its value since this is the row number column + this._executeResult.columns = dataSet.columnDefinitions.slice(1).map(def => def.name); this._executeResult.rows = dataSet.dataRows.getRange(0, dataSet.dataRows.getLength()).map(gridRow => { - return gridRow.values.map(cell => (cell.invariantCultureDisplayValue === null || cell.invariantCultureDisplayValue === undefined) ? cell.displayValue : cell.invariantCultureDisplayValue); + return gridRow.values.slice(1).map(cell => (cell.invariantCultureDisplayValue === null || cell.invariantCultureDisplayValue === undefined) ? cell.displayValue : cell.invariantCultureDisplayValue); }); }