whh666

echarts自定义平均线样式

自定义平均线样式

效果:

代码:

series: [
          {
            name: val,
            type: \'bar\',
            barWidth: 40,//柱子宽度
            label: {
              show: true
            },
            data: this.sortData(val),
            markLine: {
              
              symbol: \'none\',//取消开始结束标记(不显示箭头)
              data: [
                { //支持 average,min,max
                  type: \'average\',
                  name: \'平均值\',
                  label:{  //自定义显示标签
                    normal: {
                      color:\'#000\',
                      formatter: function(params) {
                        return \'平均值\' + params.value
                      },
                    }
                  },
                  lineStyle: {
                    normal: {
                      color: \'#d87d40\',
                      width: 2,
                      type: \'solid\'
                    }
                  }
                },
              ]
            },
          }
        ]

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-12-23
  • 2023-03-04
  • 2021-05-05
  • 2021-11-27
猜你喜欢
  • 2022-12-23
  • 2022-01-06
  • 2022-02-22
  • 2021-11-21
  • 2022-12-23
  • 2021-11-20
  • 2021-12-10
相关资源
相似解决方案