zoukankan      html  css  js  c++  java
  • 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
              }
            ]
          });
  • 相关阅读:
    html-----018----HTML Web Server/HTML URL 字符编码
    html-----017
    SQL Server 2008 R2评估期已过的解决办法和sqlserver 服务器打不开问题
    Eclipse快捷键大全
    with递归
    PIVOT使用
    SSH框架搭建
    更换开发环境后设置Tomcat和jdk版本
    MyBatis 一对多和多对一关联查询
    MyBatis 使用接口增删改查和两表一对一级联查询
  • 原文地址:https://www.cnblogs.com/JeneryYang/p/9177437.html
Copyright © 2011-2022 走看看