vue引用echarts实现数据集折线图,修改基本样式。

<template>
  <div id="project-attendance">
      <div class="project-attendance-chart-view">
        <div class="Chart_one" id="myChartCurve"></div>
      </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      list: []
    }
  },
  mounted() {
    this.drawLine()
  },
  methods: {
    drawLine() {
      let myChart = this.$echarts.init(document.getElementById('myChartCurve'))
      let options = {
        color: ["#2DECF2", '#1A8FF2'],
        tooltip: {
          trigger: 'axis',
          axisPointer: {            // 坐标轴指示器,坐标轴触发有效
            type: 'shadow'          // 默认为直线,可选为:'line' | 'shadow'
          }
        },
        grid: {
          left: '7%',
          right: '3%',
          top: '12%',
          bottom: '1%',
          containLabel: true
        },
        legend: {
          data: ['出勤人数', '在册人数'],
          textStyle: {
            fontSize: '12',
            color: '#fff'
          }
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: [],
          axisLabel: {
            interval: 0,
            rotate: 40,
            textStyle: {
              fontSize: '12',
              color: '#fff'
            }
          },
        },
        yAxis: {
          type: 'value',
          // splitLine:{show: false},//去除网格线
          axisLabel: {
            textStyle: {
              fontSize: '12',
              color: '#fff'
            }
          },
          splitLine: {  //分割线
              lineStyle:{
                  width: 2,
                  color:"rgba(48, 98, 105, 0.3)"
              }
          }
          
        },
        series: [{
          name: '出勤人数',
          smooth: true,
          symbol: 'none',
          data: [],
          type: 'line',
          // 区域填充样式 设置渐变颜色
          areaStyle: {
              color: {
                  type: 'linear',
                  x: 0,
                  y: 0,
                  x2: 0,
                  y2: 1,
                  colorStops: [{
                      offset: 0, color: 'rgba(45, 236, 242, 0.4)' // 0% 处的颜色
                  }, {
                      offset: 1, color: 'rgba(45, 236, 242, 0.1)' // 100% 处的颜色
                  }],
                  global: false // 缺省为 false
              }
          },
        },
        {
          name: '在册人数',
          smooth: true,
          symbol: 'none',
          data: [],
          type: 'line',
          areaStyle: {
              color: {
                  type: 'linear',
                  x: 0,
                  y: 0,
                  x2: 0,
                  y2: 1,
                  colorStops: [{
                      offset: 0, color: 'rgba(26, 143, 242, 0.4)' // 0% 处的颜色
                  }, {
                      offset: 1, color: 'rgba(26, 143, 242, 0.1)' // 100% 处的颜色
                  }],
                  global: false // 缺省为 false
              }
          },
        }]
      };
      myChart.setOption(options)
    },
  }
}
</script>

<style lang="less" scoped>
#project-attendance {
  width: 100%;
  height: 100%;
  .project-attendance-chart-view{
      width: 100%;
      height: 100%;
      .Chart_one{
        width: 100%;
        height: 100%;
        padding: 10px;
        box-sizing: border-box;
      }
  }
}
</style>

 该吃午饭了,各位选菜吧。蒸羊羔,蒸熊掌,蒸鹿尾儿,烧花鸭,烧雏鸡,烧子鹅,卤猪,卤鸭,酱鸡,腊肉,松花小肚儿,晾肉香肠,什锦苏盘,熏鸡白肚,清蒸八宝猪,江米酿鸭子

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值