From d7b4f8005561585fc0fac3610a04bedb299d7cd1 Mon Sep 17 00:00:00 2001 From: Yun Chen Date: Thu, 2 Aug 2018 12:33:00 +0800 Subject: [PATCH] [BugFix] Fix chart data type and requirement By watching TimelineChart Example: [Charts Demo](https://pro.ant.design/components/Charts#scaffold-src-components-Charts-demo-mini-area) ```javascript const chartData = []; for (let i = 0; i < 20; i += 1) { chartData.push({ x: (new Date().getTime()) + (1000 * 60 * 30 * i), y1: Math.floor(Math.random() * 100) + 1000, y2: Math.floor(Math.random() * 100) + 10, }); } ``` 1. X-Axis (Timeline): The type should be like `number`. 2. Y-Axis (Value): The y2 may not be required if I just want to draw y1 only. --- src/components/Charts/TimelineChart/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Charts/TimelineChart/index.d.ts b/src/components/Charts/TimelineChart/index.d.ts index d9312fe6..40b94325 100644 --- a/src/components/Charts/TimelineChart/index.d.ts +++ b/src/components/Charts/TimelineChart/index.d.ts @@ -1,11 +1,11 @@ import * as React from 'react'; export interface ITimelineChartProps { data: Array<{ - x: string; - y1: string; - y2: string; + x: number; + y1: number; + y2?: number; }>; - titleMap: { y1: string; y2: string }; + titleMap: { y1: string; y2?: string }; padding?: [number, number, number, number]; height?: number; style?: React.CSSProperties; -- GitLab