UNPKG

3.77 kBTypeScriptView Raw
1import { TextStyle, ViewStyle } from "react-native";
2import { CircleProps, TextProps } from "react-native-svg";
3export interface Dataset {
4 /** The data corresponding to the x-axis label. */
5 data: number[];
6 /** A function returning the color of the stroke given an input opacity value. */
7 color?: (opacity: number) => string;
8 /** The width of the stroke. Defaults to 2. */
9 strokeWidth?: number;
10 /** A boolean indicating whether to render dots for this line */
11 withDots?: boolean;
12 /** Override of LineChart's withScrollableDot property just for this dataset */
13 withScrollableDot?: boolean;
14}
15export interface ChartData {
16 /** The x-axis labels */
17 labels: string[];
18 datasets: Dataset[];
19}
20export interface ChartConfig {
21 backgroundColor?: string;
22 /**
23 * Defines the first color in the linear gradient of a chart's background
24 */
25 backgroundGradientFrom?: string;
26 /**
27 * Defines the first color opacity in the linear gradient of a chart's background
28 */
29 backgroundGradientFromOpacity?: number;
30 /**
31 * Defines the second color in the linear gradient of a chart's background
32 */
33 backgroundGradientTo?: string;
34 /**
35 * Defines the second color opacity in the linear gradient of a chart's background
36 */
37 backgroundGradientToOpacity?: number;
38 fillShadowGradient?: string;
39 fillShadowGradientOpacity?: number;
40 /**
41 * Defines the option to use color from dataset to each chart data
42 */
43 useShadowColorFromDataset?: boolean;
44 /**
45 * Defines the base color function that is used to calculate colors of labels and sectors used in a chart
46 */
47 color?: (opacity: number, index?: number) => string;
48 /**
49 * Defines the function that is used to calculate the color of the labels used in a chart.
50 */
51 labelColor?: (opacity: number) => string;
52 /**
53 * Defines the base stroke width in a chart
54 */
55 strokeWidth?: number;
56 /**
57 * Defines the percent (0-1) of the available width each bar width in a chart
58 */
59 barPercentage?: number;
60 barRadius?: number;
61 /**
62 * Override styles of the background lines, refer to react-native-svg's Line documentation
63 */
64 propsForBackgroundLines?: object;
65 /**
66 * Override styles of the labels, refer to react-native-svg's Text documentation
67 */
68 propsForLabels?: TextProps;
69 /**
70 * Override styles of the dots, refer to react-native-svg's Text documentation
71 */
72 propsForDots?: CircleProps;
73 decimalPlaces?: number;
74 style?: Partial<ViewStyle>;
75 /**
76 * Define stroke line join type
77 */
78 linejoinType?: "miter" | "bevel" | "round";
79 /**
80 * Define fill color for scrollable dot
81 */
82 scrollableDotFill?: string;
83 /**
84 * Define stroke color for scrollable dot
85 */
86 scrollableDotStrokeColor?: string;
87 /**
88 * Define stroke width for scrollable dot
89 */
90 scrollableDotStrokeWidth?: number;
91 /**
92 * Define radius for scrollable dot
93 */
94 scrollableDotRadius?: number;
95 /**
96 * Override style for additional info view upper scrollable dot
97 */
98 scrollableInfoViewStyle?: Partial<ViewStyle>;
99 /**
100 * Override text style for additional info view upper scrollable dot
101 */
102 scrollableInfoTextStyle?: Partial<TextStyle>;
103 scrollableInfoTextDecorator?: (value: number) => string;
104 /**
105 * Set Info View offset
106 */
107 scrollableInfoOffset?: number;
108 /**
109 * Set Info View size
110 */
111 scrollableInfoSize?: Size;
112}
113export interface Size {
114 width: number;
115 height: number;
116}
117export declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
118//# sourceMappingURL=HelperTypes.d.ts.map
\No newline at end of file