From 342cc5525cd809067a509334aa9af111a4feec8a Mon Sep 17 00:00:00 2001 From: Violet Voronetzky Date: Mon, 9 Dec 2019 11:49:51 +0200 Subject: [PATCH] Fixed datetime bug --- package.json | 2 +- src/transformers/limitVisResults.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 471e544..999062b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adx-query-charts", - "version": "1.1.1", + "version": "1.1.2", "description": "Draw charts from Azure Data Explorer queries", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/transformers/limitVisResults.ts b/src/transformers/limitVisResults.ts index c94af33..17f67d0 100644 --- a/src/transformers/limitVisResults.ts +++ b/src/transformers/limitVisResults.ts @@ -74,12 +74,10 @@ export class _LimitVisResults { this.limitAllRows(internalParams, limitedResults); this.aggregateAndEscapeRows(internalParams, limitedResults); - const xIndex = params.axesIndexes.xAxis; - // Sort the x-Axis only if it's a date time column if (params.xColumnType === DraftColumnType.DateTime) { // Remove empty date values since they can't be placed on the x-axis timeline, then sort by the date - limitedResults.rows = _.sortBy(limitedResults.rows.filter(row => row[xIndex] != null), (row) => { + limitedResults.rows = _.sortBy(limitedResults.rows.filter(row => row[0] != null), (row) => { return moment(row[0]).valueOf(); }); }