UNPKG

1.03 kBTypeScriptView Raw
1import React from 'react';
2import { Chart } from '@antv/g2/lib/chart';
3import { TooltipCfg } from '@antv/g2/lib/interface';
4import './actions';
5export interface ITooltip extends TooltipCfg, React.ComponentProps<any> {
6 /** 图例是否可见 */
7 visible?: boolean;
8 /** 自定义Tooltip */
9 children?: (title?: string, items?: any[], x?: number, y?: number) => {};
10 [key: string]: any;
11 /** 触发事件条件 */
12 triggerOn?: 'hover' | 'click';
13 /** Tooltip显示时 */
14 onShow?: (e?: ITooltipEvent, chart?: Chart) => void;
15 /** Tooltip改变时 */
16 onChange?: (e?: ITooltipEvent, chart?: Chart) => void;
17 /** Tooltip隐藏时 */
18 onHide?: (e?: ITooltipEvent, chart?: Chart) => void;
19}
20export interface ITooltipEvent {
21 items: any[];
22 title: string;
23 x: number;
24 y: number;
25}
26declare function Tooltip(props: ITooltip): React.JSX.Element;
27declare namespace Tooltip {
28 var defaultProps: {
29 showMarkers: boolean;
30 triggerOn: string;
31 };
32}
33export default Tooltip;