Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chat:timeline): fix y2 to be optional #1622

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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