Skip to content

Commit

Permalink
fix(chat:timeline): fix y2 to be optional (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Jul 21, 2023
1 parent f9de83f commit b565ddf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/chart/timeline/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module: import { G2TimelineModule } from '@delon/chart/timeline';
| `[delay]` | 延迟渲染,单位:毫秒 | `number` | `0` |
| `[title]` | 图表标题 | `string,TemplateRef<void>` | - |
| `[maxAxis]` | 最大指标数量 | `number` | `2` |
| `[data]` | 数据 | `G2TimelineData[]` | - |
| `[data]` | 数据,注:根据 `maxAxis` 值传递指标数据 | `G2TimelineData[]` | - |
| `[titleMap]` | 指标别名 | `G2TimelineMap` | - |
| `[colorMap]` | 颜色 | `G2TimelineMap` | `{ y1: '#5B8FF9', y2: '#5AD8A6', y3: '#5D7092', y4: '#F6BD16', y5: '#E86452' }` |
| `[height]` | 高度值 | `number` | `400` |
Expand Down
9 changes: 7 additions & 2 deletions packages/chart/timeline/timeline.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import { toDate } from '@delon/util/date-time';
import { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';
import type { NzSafeAny } from 'ng-zorro-antd/core/types';

/**
* 数据
*
* 注:根据 `maxAxis` 值传递指标数据
*/
export interface G2TimelineData {
/**
* 时间值
Expand All @@ -25,7 +30,7 @@ export interface G2TimelineData {
/** 指标1数据 */
y1: number;
/** 指标2数据 */
y2: number;
y2?: number;
/** 指标3数据 */
y3?: number;
/** 指标4数据 */
Expand All @@ -39,7 +44,7 @@ export interface G2TimelineMap {
/** 指标1 */
y1: string;
/** 指标 */
y2: string;
y2?: string;
/** 指标3 */
y3?: string;
/** 指标4 */
Expand Down

0 comments on commit b565ddf

Please sign in to comment.