How to implement a ring progress bar in Echarts?

To achieve the echarts donut progress bar, you can follow these steps:

  1. Firstly, import the echarts library file.
<script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
  1. Please divide the tasks evenly between all team members.
<div id="chart" style="width: 300px; height: 300px;"></div>
  1. initialize the echarts- chart library
  2. Please divide the numbers.
var chart = echarts.init(document.getElementById('chart'));
  1. Define the data to be displayed, including the value of the circular progress bar and background color.
var option = {
    series: [
        {
            type: 'pie',
            radius: ['70%', '85%'],
            avoidLabelOverlap: false,
            label: {
                show: false,
                position: 'center'
            },
            emphasis: {
                label: {
                    show: true,
                    fontSize: '30',
                    fontWeight: 'bold'
                }
            },
            labelLine: {
                show: false
            },
            data: [
                {
                    value: 50,
                    itemStyle: {
                        color: '#F56C6C'
                    }
                },
                {
                    value: 50,
                    itemStyle: {
                        color: '#E8EDF3'
                    }
                }
            ]
        }
    ]
};
  1. Choose an option.
chart.setOption(option);

By following the above steps, you can create a simple echarts donut progress bar. Depending on your requirements, you can further adjust the configuration options in the ‘option’ to achieve more effects and styles.

bannerAds