UNPKG

2.19 kBTypeScriptView Raw
1// Type definitions for ReactNativeChartKit 2.6
2// Project: https://github.com/indiespirit/react-native-chart-kit
3// TypeScript Version: 3.0
4
5import * as React from "react";
6
7// LineChart
8export interface LineChartProps {
9 data: object;
10 width: number;
11 height: number;
12 withDots?: boolean;
13 withShadow?: boolean;
14 withInnerLines?: boolean;
15 withOuterLines?: boolean;
16 fromZero?: boolean;
17 yAxisLabel?: string;
18 chartConfig: object;
19 decorator?: Function;
20 onDataPointClick?: Function;
21 style?: object;
22 bezier?: boolean;
23 getDotColor?: (dataPoint: any, index: number) => string;
24 horizontalLabelRotation?: number;
25 verticalLabelRotation?: number;
26}
27
28export class LineChart extends React.Component<LineChartProps> {}
29
30// ProgressChart
31export interface ProgressChartProps {
32 data: Array<number>;
33 width: number;
34 height: number;
35 chartConfig: object;
36}
37
38export class ProgressChart extends React.Component<ProgressChartProps> {}
39
40// BarChart
41export interface BarChartProps {
42 data: object;
43 width: number;
44 height: number;
45 fromZero?: boolean;
46 yAxisLabel: string;
47 chartConfig: object;
48 style?: object;
49 horizontalLabelRotation?: number;
50 verticalLabelRotation?: number;
51}
52
53export class BarChart extends React.Component<BarChartProps> {}
54
55// StackedBarChart
56export interface StackedBarChartProps {
57 data: object;
58 width: number;
59 height: number;
60 chartConfig: object;
61 style?: object;
62}
63
64export class StackedBarChart extends React.Component<StackedBarChartProps> {}
65
66// PieChart
67export interface PieChartProps {
68 data: Array<any>;
69 width: number;
70 height: number;
71 chartConfig: object;
72 accessor: string;
73 backgroundColor: string;
74 paddingLeft: string;
75 center?: Array<number>;
76 absolute?: boolean;
77 hasLegend?: boolean;
78}
79
80export class PieChart extends React.Component<PieChartProps> {}
81
82// ContributionGraph
83export interface ContributionGraphProps {
84 values: Array<any>;
85 endDate: Date;
86 numDays: number;
87 width: number;
88 height: number;
89 chartConfig: object;
90 accessor?: string;
91}
92
93export class ContributionGraph extends React.Component<
94 ContributionGraphProps
95> {}
96
97// AbstractChart
98export class AbstractChart extends React.Component {}