From 6818b51c5b6556ac5f75b2df7524535c6294c50e Mon Sep 17 00:00:00 2001 From: Pierre FROMAGER Date: Mon, 20 May 2019 23:30:36 +0200 Subject: [PATCH] IChartistSeriesData.data is not only an array of number (#35490) * bugfix/DefinitelyTyped : IChartistSeriesData.data is not only an array of number * bugfix/DefinitelyTyped : IChartistSeriesData.data is not only an array of number cleaner * test/DefinitelyTyped : IChartistSeriesData.data is not only an array of number - Test * test/DefinitelyTyped : IChartistSeriesData.data - Test - missing ending new line --- types/chartist/chartist-tests.ts | 29 +++++++++++++++++++++++++++++ types/chartist/index.d.ts | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts index 863fdb33be..622e284436 100644 --- a/types/chartist/chartist-tests.ts +++ b/types/chartist/chartist-tests.ts @@ -535,3 +535,32 @@ new Chartist.Line('.ct-chart', { ] ] }, {}) + +new Chartist.Line('.ct-chart', { + labels: [new Date(143134652600), new Date(143384652600)], + series: [ + { + name: 'remaining', + data: [ + { x: new Date(143134652600), y: 53 }, + { x: new Date(143334652600), y: 40 }, + { x: new Date(143354652600), y: 45 }, + { x: new Date(143356652600), y: 41 }, + { x: new Date(143366652600), y: 40 }, + { x: new Date(143368652600), y: 38 }, + { x: new Date(143378652600), y: 34 }, + { x: new Date(143568652600), y: 32 }, + { x: new Date(143569652600), y: 18 }, + { x: new Date(143579652600), y: 11 } + ] + }, { + name: 'stories', + data: [ + { x: new Date(143134652600), y: 53 }, + { x: new Date(143334652600), y: 30 }, + { x: new Date(143384652600), y: 30 }, + { x: new Date(143568652600), y: 10 } + ] + } + ] +}, {}) diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index 86cc44667d..8437ee0272 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -99,7 +99,7 @@ declare namespace Chartist { interface IChartistSeriesData { name?: string; value?: number; - data?: Array; + data?: Array | Array<{ x: number | Date, y: number }>; className?: string; meta?: any; }