PieChart.jsx 1.2 KB
Newer Older
tdgiang committed
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 ReactEcharts from 'echarts-for-react'
import { useTheme } from '@material-ui/core/styles'
import { Typography } from '@material-ui/core'

const CustomLineChart = ({ data, color }) => {
    //const { textLeft, textRight, data, bg, height } = item
    const option = {
        color: color,
        tooltip: {
            show: true,
        },
        // legend: {
        //     top: '50%',
        //     left: 'center',

        // },
        series: [
            {
                name: 'Access From',
                type: 'pie',
                radius: ['60%', '80%'],
                avoidLabelOverlap: false,
                label: {
                    show: false,
                    position: 'center',
                },
                emphasis: {
                    label: {
                        show: true,
                        fontSize: 10,
                        fontWeight: 'bold',
                    },
                },
                labelLine: {
                    show: false,
                },
                data: data,
            },
        ],
    }

    return <ReactEcharts style={{ height: 300 }} option={option} />
}

export default CustomLineChart