场景:柱状图实现重合并且以虚线展示

措施:代码如下

barGap表示不同系列的柱间距离,默认为30%表示柱子宽度的 30%

option = {
    xAxis: {
        data: ['a', 'b', 'c', 'd'],
        axisTick: {show: false}
    },
    yAxis: {
        splitLine: {show: false}
    },
    animationDurationUpdate: 1200,
    series: [{
        type: 'bar',
           itemStyle: {
                normal: {
                    color: 'transparent',
                    barBorderColor: 'tomato',
                    barBorderWidth:2,
                    barBorderRadius:0,
                    borderType:"dotted"
                    
                }
                
            },
        silent: true,
        barWidth: 40,
        barGap: '-100%', // 柱子重叠
        data: [60, 60, 60, 60]
    }, {
        type: 'bar',
        barWidth: 40,
        z: 10,
        data: [45, 60, 13, 25]
    }]
};

 

相关文章:

  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2022-12-23
  • 2021-06-06
  • 2022-01-03
  • 2021-06-20
  • 2021-12-27
  • 2021-08-29
相关资源
相似解决方案