Fix Wrong Formatter Type of <Legend />

This commit is contained in:
ZheyangSong
2018-02-16 10:46:25 -08:00
parent 7a430c4696
commit 8a2ab1a1ed
+2 -1
View File
@@ -13,6 +13,7 @@ import { CurveFactory } from 'd3-shape';
export type Percentage = string;
export type RechartsFunction = (...args: any[]) => void;
export type LegendValueFormatter = (value?: LegendPayload['value'], entry?: LegendPayload, i?: number) => any;
export type TickFormatterFunction = (value: any) => any;
export type TickGeneratorFunction = (noTicksProps: object) => any[];
export type LabelFormatter = (label: string | number) => React.ReactNode;
@@ -370,7 +371,7 @@ export interface LegendProps {
verticalAlign?: 'top' | 'middle' | 'bottom';
margin?: Partial<Margin>;
payload?: LegendPayload[];
formatter?: RechartsFunction;
formatter?: LegendValueFormatter;
onClick?: RechartsFunction;
onMouseEnter?: RechartsFunction;
onMouseLeave?: RechartsFunction;