UNPKG

2.35 kBTypeScriptView Raw
1import Component from '../../base/component';
2import { DataRecord, px, TextAttrs, LineAttrs, RectAttrs } from '../../types';
3import { ChartChildProps } from '../../chart';
4export interface TooltipProps extends ChartChildProps {
5 /**
6 * 顶部边距
7 */
8 padding?: px;
9 /**
10 * 显示事件名,默认为 press, 可以为 touchstart 等
11 */
12 triggerOn?: string;
13 /**
14 * 消失的事件名,默认为 pressend, 可以为 touchend 等
15 */
16 triggerOff?: string;
17 /**
18 * 是否一直显示
19 */
20 alwaysShow?: boolean;
21 /**
22 * 是否显示十字线
23 */
24 showCrosshairs?: boolean;
25 /**
26 * 十字线类型
27 */
28 crosshairsType?: 'x' | 'y' | 'xy';
29 /**
30 * 十字线样式
31 */
32 crosshairsStyle?: LineAttrs;
33 snap?: boolean;
34 /**
35 * 名称样式
36 */
37 nameStyle?: TextAttrs;
38 /**
39 * 值样式
40 */
41 valueStyle?: TextAttrs;
42 /**
43 * 背景样式
44 */
45 background?: RectAttrs;
46 /**
47 * 是否显示
48 */
49 showItemMarker?: boolean;
50}
51export interface TooltipState {
52 records: DataRecord[];
53}
54declare const _default: (View: any) => {
55 new (props: TooltipProps): {
56 updateCoord(): void;
57 willMount(): void;
58 didMount(): void;
59 willReceiveProps(nextProps: any): void;
60 _initShow(): void;
61 _showByData(dataItem: any): void;
62 _triggerOn: (ev: any) => void;
63 _triggerOff: () => void;
64 _initEvent(): void;
65 didUnmount(): void;
66 _clearEvents(): void;
67 show(point: any, _ev?: any): void;
68 hide(): void;
69 render(): import("../..").JSX.Element;
70 props: TooltipProps;
71 state: TooltipState;
72 context: import("../../base/component").ComponentContext;
73 refs: {
74 [key: string]: Component<any, any>;
75 };
76 updater: import("../../base/component").Updater<TooltipState>;
77 children: import("../..").JSX.Element;
78 container: any;
79 animate: boolean;
80 destroyed: boolean;
81 willUpdate(): void;
82 didUpdate(): void;
83 setState(partialState: TooltipState, callback?: () => void): void;
84 forceUpdate(callback?: () => void): void;
85 setAnimate(animate: boolean): void;
86 destroy(): void;
87 };
88};
89export default _default;