1 | import Component from '../../base/component';
|
2 | import Chart from '../../chart';
|
3 | import { Style, TextAttrs } from '../../types';
|
4 | interface LegendItem {
|
5 | |
6 |
|
7 |
|
8 | color: string;
|
9 | |
10 |
|
11 |
|
12 | name: string;
|
13 | |
14 |
|
15 |
|
16 | value?: string | number;
|
17 | |
18 |
|
19 |
|
20 | marker?: string;
|
21 | }
|
22 | export interface LegendProps {
|
23 | |
24 |
|
25 |
|
26 | readonly chart?: Chart;
|
27 | |
28 |
|
29 |
|
30 | position?: 'right' | 'left' | 'top' | 'bottom';
|
31 | |
32 |
|
33 |
|
34 | width?: number | string;
|
35 | |
36 |
|
37 |
|
38 | height?: number | string;
|
39 | |
40 |
|
41 |
|
42 | margin?: number | string;
|
43 | |
44 |
|
45 |
|
46 | itemFormatter?: (value: string, name: string) => string;
|
47 | |
48 |
|
49 |
|
50 | items?: LegendItem[];
|
51 | |
52 |
|
53 |
|
54 | style?: Style;
|
55 | |
56 |
|
57 |
|
58 | marker?: 'circle' | 'square' | 'line';
|
59 | |
60 |
|
61 |
|
62 | itemStyle?: Style;
|
63 | |
64 |
|
65 |
|
66 | nameStyle?: TextAttrs;
|
67 | |
68 |
|
69 |
|
70 | valueStyle?: TextAttrs;
|
71 | |
72 |
|
73 |
|
74 | valuePrefix?: string;
|
75 | |
76 |
|
77 |
|
78 | clickable?: boolean;
|
79 | onClick?: (item: LegendItem) => void;
|
80 | }
|
81 | declare const _default: (View: any) => {
|
82 | new (props: any): {
|
83 | style: Style;
|
84 | itemWidth: Number;
|
85 | getOriginItems(): any;
|
86 | getItems(): any;
|
87 | setItems(items: any): void;
|
88 | getMaxItemBox(legendShape: any): {
|
89 | width: number;
|
90 | height: number;
|
91 | };
|
92 | _init(): void;
|
93 | updateCoord(): void;
|
94 | willMount(): void;
|
95 | didMount(): void;
|
96 | willUpdate(): void;
|
97 | _initEvent(): void;
|
98 | render(): import("../..").JSX.Element;
|
99 | props: LegendProps;
|
100 | state: any;
|
101 | context: import("../../base/component").ComponentContext;
|
102 | refs: {
|
103 | [key: string]: Component<any, any>;
|
104 | };
|
105 | updater: import("../../base/component").Updater<any>;
|
106 | children: import("../..").JSX.Element; |
107 |
|
108 |
|
109 | container: any;
|
110 | |
111 |
|
112 |
|
113 | animate: boolean;
|
114 | destroyed: boolean;
|
115 | willReceiveProps(_props: LegendProps, context?: LegendProps): void;
|
116 | didUpdate(): void;
|
117 | didUnmount(): void;
|
118 | setState(partialState: any, callback?: () => void): void;
|
119 | forceUpdate(callback?: () => void): void;
|
120 | setAnimate(animate: boolean): void;
|
121 | destroy(): void;
|
122 | };
|
123 | };
|
124 | export default _default;
|