echarts实现折线面积图

var option4 = {
  // legend: {
  //   data: ['吃饭', '睡觉', '打豆豆'],
  //   icon: 'rect',
  //   top: 22,
  //   right: 24,
  //   itemGap: 15,
  //   itemWidth: 10,
  //   itemHeight: 10,
  //   textStyle: {
  //     // padding: [0, 0, 0, 5],
  //     color: 'rgba(0,0,0,0.87)'
  //   }
  // },
  color: ['#289df5', '#fbc01b', '#ff5050'],
  grid: {
    left: '4%',
    right: '6%',
    bottom: '3%',
    containLabel: true
  },
  tooltip: {
    trigger: 'axis',
    // borderWidth:'0',
    borderColor:'#85b3f1',
    backgroundColor:'rgba(133,179,241,1)',//通过设置rgba调节背景颜色与透明度
    axisPointer: {
      animation: false
    },
    formatter: function (params) {
      var htmlStr = '';
      htmlStr += '<div><span style="color:#fff;">' + params[0].name + '</span>';
      for(var i=0;i<params.length;i++){
        htmlStr += ':<span style="color:#fff;">' + params[i].value + '&nbsp;</span><br/>';
      }
      htmlStr += '</div>';
      return  htmlStr
    },
  },
  xAxis: {
    type: 'category',
    axisLine: {
      lineStyle: {
        color: "#a6abab" // y坐标轴的轴线颜色
      }
    },
    axisTick: {
      length: 0
    },
    axisLabel: {
      interval: 0,
      textStyle: {
        color: '#bdbdbd'
      }
    },
    // name: '(机台号)',
    // nameTextStyle: {
    //   padding: [10, 0, 0, 0],
    //   color: '#bdbdbd'
    // },
    nameGap: 0,
    data: this.OEEX
  },
  yAxis: {
    type: 'value',
    axisLine: {
      lineStyle: {
        color: "#a6abab" // y坐标轴的轴线颜色
      }
    },
    axisTick: {
      length: 0 // 刻度线的长度
    },
    splitLine: {//y轴的网格
      lineStyle: {
        color: ["#eee"],
        width: 1,
        type: 'solid'
      }
    },
    axisLabel: {
      textStyle: {
        color: '#a3a4b2'
      }
    }
  },
  series: [{
    name: '工艺1',
    type: 'line',
    smooth: true,
    symbol: 'circle', // 拐点类型
    symbolSize: 0, // 拐点圆的大小
    itemStyle: {
      normal: {
        color: '#6da4ef', // 折线条的颜色
        borderColor: '#6da4ef', // 拐点边框颜色
        areaStyle: {
          type: 'default',
          opacity: 0.1
        }
      }
    },
    data:this.OEEY
  }]
};
this.chart4 = this.echarts.init(document.getElementById("chart4")); //定义
this.chart4.clear();
this.chart4.setOption(option4); //展示复制代码
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值