summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/containers/Charts/demos/LineVertical.js
blob: 28ffc079feda4996bd14b7ba2b28cf13a34586ff (plain)
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
import React from 'react';
import { createMuiTheme } from '@material-ui/core/styles';
import ThemePallete from 'ba-api/themePalette';
import {
  LineChart,
  Line,
  XAxis,
  YAxis,
  CartesianGrid,
  Tooltip,
  Legend
} from 'recharts';
import { data1 } from './sampleData';

const theme = createMuiTheme(ThemePallete.cyanTheme);
const color = ({
  primary: theme.palette.primary.main,
  secondary: theme.palette.secondary.main,
});

function LineVertical() {
  return (
    <LineChart
      width={800}
      height={450}
      data={data1}
      layout="vertical"
      margin={{
        top: 5,
        right: 30,
        left: 20,
        bottom: 5
      }}
    >
      <CartesianGrid strokeDasharray="3 3" />
      <XAxis type="number" />
      <YAxis dataKey="name" type="category" />
      <Tooltip />
      <Legend />
      <Line type="monotone" dataKey="pv" stroke={color.primary} activeDot={{ r: 8 }} />
      <Line type="monotone" dataKey="uv" stroke={color.secondary} />
    </LineChart>
  );
}

export default LineVertical;