1import * as Font from 'expo-font';
2import React from 'react';
3import { Dimensions, Text, View } from 'react-native';
4import * as Svg from 'react-native-svg';
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            drawn with victory-native
64          </Svg.Text>
65        </Svg.Svg>
66      </View>
67    );
68  }
69}
70
71const icon = <Text>VN</Text>;
72
73const VictoryNative: Example = {
74  icon,
75  samples: [VictoryChartExample],
76};
77
78export default VictoryNative;
79