帆软调整柱状图的颜色

 

setTimeout(function() {
    //调整整个柱形图的位置
    //document.getElementsByTagName("svg")[0].style.transform = "translate3d(0px, 14px, 0px)";
    var bars = document.getElementsByTagName("svg");
    if (bars && typeof(bars) != 'undefined' && bars != 0 && bars.length > 0) {
        var bars0 = bars[0].firstElementChild.getElementsByTagName("linearGradient");
        if (bars0 && typeof(bars0) != 'undefined' && bars0 != 0 && bars0.length > 0) {
            //系列1
            for (var i = 0; i < recordnum; i++) {
                if (bars0[i].childNodes && typeof(bars0[i].childNodes) != 'undefined') {

                    bars0[i].childNodes[0].style.stopColor = "#2de84f"; //#102337
                    bars0[i].childNodes[1].style.stopColor = "#8cffb2"; //02aff6
                }
            }
            //系列2
            if (bars0.length > recordnum) {
                for (var i = recordnum - 1; i < recordnum * 2 - 2; i++) {
                    if (bars0[i].childNodes && typeof(bars0[i].childNodes) != 'undefined' && bars0[i].childNodes != 0) {
                        bars0[i].childNodes[0].style.stopColor = "#005c6d";
                        bars0[i].childNodes[1].style.stopColor = "#01f8f5";
                    }
                }
            }

        }
    }
}, 5000)

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
猜你喜欢
  • 2022-03-09
  • 2022-12-23
  • 2022-02-26
  • 2021-05-26
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案