增加tooltip
This commit is contained in:
25
src/types/analysis/industry.d.ts
vendored
25
src/types/analysis/industry.d.ts
vendored
@@ -1,4 +1,5 @@
|
||||
import dayjs from 'dayjs';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export type TimeDimension = '月' | '季度' | '年';
|
||||
export type AnalysisType = '岗位发布数量' | '招聘增长率';
|
||||
@@ -27,6 +28,17 @@ export interface IndustryTrendApiResult {
|
||||
msg: string;
|
||||
}
|
||||
|
||||
export interface TooltipItem {
|
||||
name: string;
|
||||
value: number;
|
||||
color: string;
|
||||
data: {
|
||||
date: string;
|
||||
category: string;
|
||||
value: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ChartConfig {
|
||||
data: IndustryDataItem[];
|
||||
height: number;
|
||||
@@ -44,7 +56,11 @@ export interface ChartConfig {
|
||||
formatter: (val: string) => string;
|
||||
};
|
||||
};
|
||||
tooltip: false;
|
||||
tooltip: {
|
||||
showTitle?: boolean;
|
||||
title?: string | ((title: string, data?: TooltipItem[]) => string);
|
||||
customContent?: (title: string, items: TooltipItem[]) => ReactNode;
|
||||
};
|
||||
point: {
|
||||
size: number;
|
||||
shape: string;
|
||||
@@ -56,6 +72,13 @@ export interface ChartConfig {
|
||||
};
|
||||
};
|
||||
smooth: boolean;
|
||||
interactions?: Array<{
|
||||
type: string;
|
||||
cfg: {
|
||||
render: (event: any, { title, items }: { title: string; items: TooltipItem[] }) => ReactNode;
|
||||
};
|
||||
}>;
|
||||
legend?: boolean;
|
||||
}
|
||||
|
||||
export type DateFormatter = (dateStr: string, dimension: TimeDimension) => string;
|
||||
|
||||
Reference in New Issue
Block a user