summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/containers/Charts/demos/CompossedVertical.js
blob: 8e6d382e9c150d96672af05dc1119a2b5eb05370 (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
47
48
49
50
51
52
import React from 'react';
import { createMuiTheme } from '@material-ui/core/styles';
import ThemePallete from 'ba-api/themePalette';
import {
  ComposedChart,
  Line,
  Area,
  Bar,
  XAxis,
  YAxis,
  CartesianGrid,
  Tooltip,
  Legend
} from 'recharts';
import { green } from '@material-ui/core/colors';
import { data1 } from './sampleData';

const theme = createMuiTheme(ThemePallete.blueTheme);
const color = ({
  main: theme.palette.primary.main,
  maindark: theme.palette.primary.dark,
  secondary: theme.palette.secondary.main,
  third: green[500],
});

function CompossedVertical() {
  return (
    <ComposedChart
      width={800}
      height={450}
      layout="vertical"
      data={data1}
      margin={{
        top: 5,
        right: 30,
        left: 20,
        bottom: 5
      }}
    >
      <CartesianGrid stroke="#f5f5f5" />
      <XAxis type="number" />
      <YAxis dataKey="name" type="category" />
      <Tooltip />
      <Legend />
      <Area dataKey="amt" fillOpacity="0.8" fill={color.main} stroke={color.maindark} />
      <Bar dataKey="pv" barSize={20} fillOpacity="0.8" fill={color.secondary} />
      <Line dataKey="uv" stroke={color.third} />
    </ComposedChart>
  );
}

export default CompossedVertical;