forked from indiespirit/react-native-chart-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
141 lines (126 loc) · 3.4 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Type definitions for ReactNativeChartKit 2.6
// Project: https://github.com/indiespirit/react-native-chart-kit
// TypeScript Version: 3.0
import * as React from "react";
// LineChart
export interface LineChartProps {
data: object;
width: number;
height: number;
withDots?: boolean;
withShadow?: boolean;
withInnerLines?: boolean;
withOuterLines?: boolean;
fromZero?: boolean;
yAxisLabel?: string;
chartConfig: ChartConfig;
decorator?: Function;
onDataPointClick?: Function;
style?: object;
bezier?: boolean;
getDotColor?: (dataPoint: any, index: number) => string;
horizontalLabelRotation?: number;
verticalLabelRotation?: number;
}
export class LineChart extends React.Component<LineChartProps> {}
// ProgressChart
export interface ProgressChartProps {
data: Array<number>;
width: number;
height: number;
chartConfig: ChartConfig;
}
export class ProgressChart extends React.Component<ProgressChartProps> {}
// BarChart
export interface BarChartProps {
data: object;
width: number;
height: number;
fromZero?: boolean;
yAxisLabel: string;
chartConfig: ChartConfig;
style?: object;
horizontalLabelRotation?: number;
verticalLabelRotation?: number;
}
export class BarChart extends React.Component<BarChartProps> {}
// StackedBarChart
export interface StackedBarChartProps {
data: object;
width: number;
height: number;
chartConfig: ChartConfig;
style?: object;
}
export class StackedBarChart extends React.Component<StackedBarChartProps> {}
// PieChart
export interface PieChartProps {
data: Array<any>;
width: number;
height: number;
chartConfig: ChartConfig;
accessor: string;
backgroundColor: string;
paddingLeft: string;
center?: Array<number>;
absolute?: boolean;
hasLegend?: boolean;
}
export class PieChart extends React.Component<PieChartProps> {}
// ContributionGraph
export interface ContributionGraphProps {
values: Array<any>;
endDate: Date;
numDays: number;
width: number;
height: number;
chartConfig: ChartConfig;
accessor?: string;
}
export class ContributionGraph extends React.Component<
ContributionGraphProps
> {}
// AbstractChart
export class AbstractChart extends React.Component {}
// ChartConfig
export interface ChartConfig {
backgroundColor?: string;
/**
* Defines the first color in the linear gradient of a chart's background
*/
backgroundGradientFrom?: string;
/**
* Defines the first color opacity in the linear gradient of a chart's background
*/
backgroundGradientFromOpacity?: number;
/**
* Defines the second color in the linear gradient of a chart's background
*/
backgroundGradientTo?: string;
/**
* Defines the second color opacity in the linear gradient of a chart's background
*/
backgroundGradientToOpacity?: number;
/**
* Defines the base color function that is used to calculate colors of labels and sectors used in a chart
*/
color: (opacity: number) => string;
/**
* Defines the base stroke width in a chart
*/
strokeWidth?: number;
/**
* Defines the percent (0-1) of the available width each bar width in a chart
*/
barPercentage?: number;
/**
* Override styles of the background lines, refer to react-native-svg's Line documentation
*/
propsForBackgroundLines?: object;
/**
* Override styles of the labels, refer to react-native-svg's Text documentation
*/
propsForLabels?: object;
decimalPlaces?: number;
style?: object;
}