UNPKG

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