Search code examples
echartsbaidu

Rounded bars in echarts


Is there are way to make the bars rounded in an ECharts chart such as the example here?


Solution

  • Use roundCap:true

    Example

    series: [{
            type: 'bar',
            data: [4, 3, 2, 1, 0],
            coordinateSystem: 'polar',
            name: 'Without Round Cap',
            color: 'rgba(200, 0, 0, 0.5)',
            itemStyle: {
                borderColor: 'red',
                borderWidth: 1
            }
        }, {
            type: 'bar',
            data: [4, 3, 2, 1, 0],
            coordinateSystem: 'polar',
            name: 'With Round Cap',
            roundCap: true,
            color: 'rgba(0, 200, 0, 0.5)',
            itemStyle: {
                borderColor: 'green',
                borderWidth: 1
            }
        }],