-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathmulti-line.js
35 lines (29 loc) · 905 Bytes
/
multi-line.js
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
import React from 'react'
import { LineChart, Path, Grid } from 'react-native-svg-charts'
class LineChartExample extends React.PureComponent {
render() {
const data1 = [ 50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80 ]
const data2 = [ -87, 66, -69, 92, -40, -61, 16, 62, 20, -93, -54, 47, -89, -44, 18 ]
//Array of datasets, following this syntax:
const data = [
{
data: data1,
svg: { stroke: 'purple' },
},
{
data: data2,
svg: { stroke: 'green' },
},
]
return (
<LineChart
style={{ height: 200 }}
data={ data }
contentInset={{ top: 20, bottom: 20 }}
>
<Grid />
</LineChart>
)
}
}
export default LineChartExample