/
ThemedLine.tsx
63 lines (62 loc) · 1.83 KB
/
ThemedLine.tsx
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react'
import { CompleteTheme } from '@nivo/core'
import { ResponsiveLine } from '@nivo/line'
export const ThemedLine = ({ theme }: { theme: CompleteTheme }) => {
return (
<ResponsiveLine
margin={{
top: 40,
right: 20,
bottom: 50,
left: 50,
}}
data={[
{
id: 'Serie 0',
data: [
{ x: 'A', y: 12 },
{ x: 'B', y: 17 },
{ x: 'C', y: 9 },
{ x: 'D', y: 15 },
{ x: 'E', y: 23 },
],
},
{
id: 'Serie 1',
data: [
{ x: 'A', y: 3 },
{ x: 'B', y: 7 },
{ x: 'C', y: 6 },
{ x: 'D', y: 12 },
{ x: 'E', y: 16 },
],
},
{
id: 'Serie 2',
data: [
{ x: 'A', y: 1 },
{ x: 'B', y: 2 },
{ x: 'C', y: 2 },
{ x: 'D', y: 5 },
{ x: 'E', y: 7 },
],
},
]}
enablePoints
enablePointLabel
pointSize={10}
theme={theme}
animate={false}
axisBottom={{
legend: 'X axis legend',
legendPosition: 'middle',
legendOffset: 34,
}}
axisLeft={{
legend: 'Y axis legend',
legendPosition: 'middle',
legendOffset: -36,
}}
/>
)
}