1 | import React from "react";
|
2 | import { Animated, TextInput, ViewStyle } from "react-native";
|
3 | import AbstractChart, { AbstractChartConfig, AbstractChartProps } from "../AbstractChart";
|
4 | import { ChartData, Dataset } from "../HelperTypes";
|
5 | export interface LineChartData extends ChartData {
|
6 | legend?: string[];
|
7 | }
|
8 | export interface LineChartProps extends AbstractChartProps {
|
9 | |
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | data: LineChartData;
|
27 | |
28 |
|
29 |
|
30 | width: number;
|
31 | |
32 |
|
33 |
|
34 | height: number;
|
35 | |
36 |
|
37 |
|
38 | withDots?: boolean;
|
39 | |
40 |
|
41 |
|
42 | withShadow?: boolean;
|
43 | |
44 |
|
45 |
|
46 | withScrollableDot?: boolean;
|
47 | withInnerLines?: boolean;
|
48 | |
49 |
|
50 |
|
51 | withOuterLines?: boolean;
|
52 | |
53 |
|
54 |
|
55 | withVerticalLines?: boolean;
|
56 | |
57 |
|
58 |
|
59 | withHorizontalLines?: boolean;
|
60 | |
61 |
|
62 |
|
63 | withVerticalLabels?: boolean;
|
64 | |
65 |
|
66 |
|
67 | withHorizontalLabels?: boolean;
|
68 | |
69 |
|
70 |
|
71 | fromZero?: boolean;
|
72 | |
73 |
|
74 |
|
75 | yAxisLabel?: string;
|
76 | |
77 |
|
78 |
|
79 | yAxisSuffix?: string;
|
80 | |
81 |
|
82 |
|
83 | xAxisLabel?: string;
|
84 | |
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | chartConfig?: AbstractChartConfig;
|
101 | |
102 |
|
103 |
|
104 | yAxisInterval?: number;
|
105 | |
106 |
|
107 |
|
108 | transparent?: boolean;
|
109 | |
110 |
|
111 |
|
112 |
|
113 |
|
114 | decorator?: Function;
|
115 | |
116 |
|
117 |
|
118 | onDataPointClick?: (data: {
|
119 | index: number;
|
120 | value: number;
|
121 | dataset: Dataset;
|
122 | x: number;
|
123 | y: number;
|
124 | getColor: (opacity: number) => string;
|
125 | }) => void;
|
126 | |
127 |
|
128 |
|
129 | style?: Partial<ViewStyle>;
|
130 | |
131 |
|
132 |
|
133 |
|
134 |
|
135 | bezier?: boolean;
|
136 | |
137 |
|
138 |
|
139 |
|
140 | getDotColor?: (dataPoint: any, index: number) => string;
|
141 | |
142 |
|
143 |
|
144 |
|
145 | renderDotContent?: (params: {
|
146 | x: number;
|
147 | y: number;
|
148 | index: number;
|
149 | }) => React.ReactNode;
|
150 | |
151 |
|
152 |
|
153 | horizontalLabelRotation?: number;
|
154 | |
155 |
|
156 |
|
157 | verticalLabelRotation?: number;
|
158 | |
159 |
|
160 |
|
161 | yLabelsOffset?: number;
|
162 | |
163 |
|
164 |
|
165 | xLabelsOffset?: number;
|
166 | |
167 |
|
168 |
|
169 | hidePointsAtIndex?: number[];
|
170 | |
171 |
|
172 |
|
173 |
|
174 | formatYLabel?: (yValue: string) => string;
|
175 | |
176 |
|
177 |
|
178 |
|
179 | formatXLabel?: (xValue: string) => string;
|
180 | |
181 |
|
182 |
|
183 | getDotProps?: (dataPoint: any, index: number) => object;
|
184 | |
185 |
|
186 |
|
187 | segments?: number;
|
188 | }
|
189 | declare type LineChartState = {
|
190 | scrollableDotHorizontalOffset: Animated.Value;
|
191 | };
|
192 | declare class LineChart extends AbstractChart<LineChartProps, LineChartState> {
|
193 | label: React.RefObject<TextInput>;
|
194 | state: {
|
195 | scrollableDotHorizontalOffset: Animated.Value;
|
196 | };
|
197 | getColor: (dataset: Dataset, opacity: number) => string;
|
198 | getStrokeWidth: (dataset: Dataset) => number;
|
199 | getDatas: (data: Dataset[]) => number[];
|
200 | getPropsForDots: (x: any, i: number) => object;
|
201 | renderDots: ({ data, width, height, paddingTop, paddingRight, onDataPointClick }: Pick<AbstractChartConfig, "data" | "height" | "width" | "paddingTop" | "paddingRight"> & {
|
202 | onDataPointClick: LineChartProps["onDataPointClick"];
|
203 | }) => React.ReactNode[];
|
204 | renderScrollableDot: ({ data, width, height, paddingTop, paddingRight, scrollableDotHorizontalOffset, scrollableDotFill, scrollableDotStrokeColor, scrollableDotStrokeWidth, scrollableDotRadius, scrollableInfoViewStyle, scrollableInfoTextStyle, scrollableInfoTextDecorator, scrollableInfoSize, scrollableInfoOffset }: AbstractChartConfig & {
|
205 | onDataPointClick: LineChartProps["onDataPointClick"];
|
206 | scrollableDotHorizontalOffset: Animated.Value;
|
207 | }) => any[];
|
208 | renderShadow: ({ width, height, paddingRight, paddingTop, data, useColorFromDataset }: Pick<AbstractChartConfig, "data" | "height" | "width" | "paddingTop" | "paddingRight"> & {
|
209 | useColorFromDataset: AbstractChartConfig["useShadowColorFromDataset"];
|
210 | }) => JSX.Element[];
|
211 | renderLine: ({ width, height, paddingRight, paddingTop, data, linejoinType }: Pick<AbstractChartConfig, "data" | "width" | "height" | "paddingRight" | "paddingTop" | "linejoinType">) => any[];
|
212 | getBezierLinePoints: (dataset: Dataset, { width, height, paddingRight, paddingTop, data }: Pick<AbstractChartConfig, "width" | "height" | "paddingRight" | "paddingTop" | "data">) => string;
|
213 | renderBezierLine: ({ data, width, height, paddingRight, paddingTop }: Pick<AbstractChartConfig, "data" | "width" | "height" | "paddingRight" | "paddingTop">) => JSX.Element[];
|
214 | renderBezierShadow: ({ width, height, paddingRight, paddingTop, data, useColorFromDataset }: Pick<AbstractChartConfig, "data" | "height" | "width" | "paddingTop" | "paddingRight"> & {
|
215 | useColorFromDataset: AbstractChartConfig["useShadowColorFromDataset"];
|
216 | }) => JSX.Element[];
|
217 | renderLegend: (width: any, legendOffset: any) => JSX.Element[];
|
218 | render(): JSX.Element;
|
219 | }
|
220 | export default LineChart;
|
221 |
|
\ | No newline at end of file |