UNPKG

1.61 kBTypeScriptView Raw
1/**
2 * @fileOverview Y Axis
3 */
4import React from 'react';
5import { BaseAxisProps, AxisInterval, PresentationAttributesAdaptChildEvent } from '../util/types';
6interface YAxisProps extends BaseAxisProps {
7 /** The unique id of y-axis */
8 yAxisId?: string | number;
9 /**
10 * Ticks can be any type when the axis is the type of category
11 * Ticks must be numbers when the axis is the type of number
12 */
13 ticks?: (string | number)[];
14 /** The width of axis, which need to be set by the user */
15 width?: number;
16 /** The height of axis which is usually calculated in Chart */
17 height?: number;
18 mirror?: boolean;
19 /** The orientation of axis */
20 orientation?: 'left' | 'right';
21 padding?: {
22 top?: number;
23 bottom?: number;
24 };
25 minTickGap?: number;
26 interval?: AxisInterval;
27 reversed?: boolean;
28 tickMargin?: number;
29}
30export type Props = Omit<PresentationAttributesAdaptChildEvent<any, SVGElement>, 'scale' | 'ref'> & YAxisProps;
31export declare class YAxis extends React.Component<Props> {
32 static displayName: string;
33 static defaultProps: {
34 allowDuplicatedCategory: boolean;
35 allowDecimals: boolean;
36 hide: boolean;
37 orientation: string;
38 width: number;
39 height: number;
40 mirror: boolean;
41 yAxisId: number;
42 tickCount: number;
43 type: string;
44 padding: {
45 top: number;
46 bottom: number;
47 };
48 allowDataOverflow: boolean;
49 scale: string;
50 reversed: boolean;
51 };
52 render(): React.JSX.Element;
53}
54export {};