aboutsummaryrefslogtreecommitdiff
path: root/front/odiparpack/app/containers/Charts/demos/PieSimple.js
blob: f0a4f6ef5948efc26cd6d037a0ac7bd8d892ac9d (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
import React from 'react';
import { createMuiTheme } from '@material-ui/core/styles';
import ThemePallete from 'ba-api/themePalette';
import {
  PieChart,
  Pie,
  Tooltip
} from 'recharts';
import { data4, data5 } from './sampleData';

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

function PieSimple() {
  return (
    <PieChart
      width={800}
      height={450}
      margin={{
        top: 5,
        right: 30,
        left: 20,
        bottom: 5
      }}
    >
      <Pie isAnimationActive={false} dataKey="value" data={data4} cx={200} cy={200} outerRadius={80} fill={color.primary} label />
      <Pie data={data5} cx={500} dataKey="value" cy={200} innerRadius={40} outerRadius={80} fill={color.secondary} />
      <Tooltip />
    </PieChart>
  );
}

export default PieSimple;