1import React from 'react';
2import { Dimensions, Text, View } from 'react-native';
3import * as Svg from 'react-native-svg';
4import * as Font from 'expo-font';
5import { VictoryArea, VictoryChart, VictoryStack } from 'victory-native';
6
7import Example from './Example';
8
9class VictoryChartExample extends React.Component {
10  static title = 'VictoryChart';
11
12  render() {
13    return (
14      <View>
15        <VictoryChart>
16          <VictoryStack>
17            <VictoryArea
18              data={[
19                { x: 'a', y: 2 },
20                { x: 'b', y: 3 },
21                { x: 'c', y: 5 },
22                { x: 'd', y: 4 },
23                { x: 'e', y: 7 },
24              ]}
25            />
26            <VictoryArea
27              data={[
28                { x: 'a', y: 1 },
29                { x: 'b', y: 4 },
30                { x: 'c', y: 5 },
31                { x: 'd', y: 7 },
32                { x: 'e', y: 5 },
33              ]}
34            />
35            <VictoryArea
36              data={[
37                { x: 'a', y: 3 },
38                { x: 'b', y: 2 },
39                { x: 'c', y: 6 },
40                { x: 'd', y: 2 },
41                { x: 'e', y: 6 },
42              ]}
43            />
44            <VictoryArea
45              data={[
46                { x: 'a', y: 2 },
47                { x: 'b', y: 3 },
48                { x: 'c', y: 3 },
49                { x: 'd', y: 4 },
50                { x: 'e', y: 7 },
51              ]}
52            />
53          </VictoryStack>
54        </VictoryChart>
55        <Svg.Svg width={Dimensions.get('window').width} height={50}>
56          <Svg.Text
57            fill="#fff"
58            stroke="#000"
59            fontSize={15}
60            fontFamily={Font.processFontFamily('space-mono')!}
61            x={25}
62            y={15}
63          >
64            drawn with victory-native
65          </Svg.Text>
66        </Svg.Svg>
67      </View>
68    );
69  }
70}
71
72const icon = <Text>VN</Text>;
73
74const VictoryNative: Example = {
75  icon,
76  samples: [VictoryChartExample],
77};
78
79export default VictoryNative;
80