• echarts颜色渐变


    myChart.setOption({
            title: {
              text: ''
            },
            tooltip : {
              trigger: 'axis',
              axisPointer: {
                type: 'cross',
                label: {
                  backgroundColor: '#6a7985'
                }
              },
              formatter: function(params, ticket, callback) {  
               return "时间:"+ params[0].axisValue + "<br/>"+ "上传流量:" + self.$methods.trafficSwitch(params[1].data) + "<br/>"+ "下载流量:" +self.$methods.trafficSwitch(params[0].data)
              } 
            },
            legend: {
              show:false,     
            },
            grid: {
              left: '0',
              right: '0',
              bottom: '0',
              containLabel: true
            },
            xAxis : [
              {
                type : 'category',
                splitLine:{show: false},
                boundaryGap : false,
                data : this.schedule,
                axisLine:{
                  lineStyle:{
                    color:"#aaa"
                  }
                }
              }
            ],
            yAxis : [
              {
                type : 'value',
                splitLine:{show: false},
                show:false, 
                axisLine:{
                  lineStyle:{
                    color:"#aaa"
                  }
                }
              }
            ],
            series : [
              {
                name:'上传流量',
                type:'line',
                smooth: true,
                areaStyle: {normal:{}},
                itemStyle: {           
                  normal: {
                    label : {show: false}, 
                    color: new echarts.graphic.LinearGradient(
                      0, 0, 0, 1,
                      [
                        {offset: 0.2, color: ' #f8a3f2'},
                        {offset: 0.5, color: '#d4c8f0'},
                        {offset: 1, color: '#d4c8f0'}
                      ]
                    )
                  }
                },
                data:this.upload_traffic
              },
              {
                name:'下载流量',
                type:'line',
                smooth: true,
                areaStyle: {normal:{}},
                itemStyle: {
                  normal: {
                    label : {show: false},
                    color: new echarts.graphic.LinearGradient(
                      0, 0, 0, 1,
                      [
                        {offset: 0.2, color: ' #2196f3'},
                        {offset: 0.5, color: '#9fdcf4'},
                        {offset: 1, color: '#9fdcf4'}
                      ]
                    )
                  }
                },
                data:this.download_traffic
              }
            ]
          });
  • 相关阅读:
    进程 线程
    random模块 时间模块 sys模块 os模块 json模块 pickle模块
    异常处理
    面向对象进阶篇
    面向对象初级篇
    正则表达式
    re模块的相关知识
    CNN归纳偏好
    window和Linux下安装nvidia的apex
    使用GrabCut做分割
  • 原文地址:https://www.cnblogs.com/JeneryYang/p/9177437.html
Copyright © 2020-2023  润新知