zoukankan      html  css  js  c++  java
  • Vue + Element 中的Echart单线图

    看图!!!

    Echart表的引入使用看文档! 

    下面给代码

    <!-- 第二部分柱形数据图 -->
            <div class="main-two-chart">
              <div class="integral-plate" id="main-two-chart" style="100%;height:200px;"></div>
            </div>
    
    
    script中的methods方法:
    
    // 第二部分的Echart图
        getMainTwoChart () {
          const myChart = this.$echarts.init(document.getElementById('main-two-chart'))
          const option = {
            tooltip: {
              trigger: 'axis',
              axisPointer: {
                type: 'shadow'
              }
            },
            grid: {
              left: '3%',
              top: '4%',
              bottom: '4%',
              containLabel: true
            },
            xAxis: {
              show: false,
              type: 'value'
            },
            yAxis: {
              type: 'category',
              // 静态
              data: [124124]
              // data: this.secondLeftData
            },
            series: [
              {
                name: '2011年',
                type: 'bar',
                data: [0, 50],
                // barWidth: 设置宽度大小
                barWidth: 10
                // 设置颜色
                // itemStyle: {
                //   normal: {
                //     color: function (params) {
                //       // build a color map as your need.
                //       var colorList = [
                //         '#3aa1ff'
                //       ]
                //       return colorList[params.dataIndex]
                //     }
                //   }
                // }
              }
            ]
          }
          myChart.setOption(option)
          window.addEventListener('resize', function () {
            myChart.resize()
          })
        },
    
    初始化调用
    mounted () {
        // 两个动态数据图的初始化调用
        this.getMainTwoChart()
    }
  • 相关阅读:
    i春秋xss平台
    i春秋exec
    bugku 你必须让他停下
    bugku 域名解析
    bugku web3
    bugku 矛盾
    (转)ubuntu下怎么放wifi热点给andriod设备
    (转)如何在 ubuntu 下使用 iNode 客户端
    博客更新啦!!
    HDU 5351 MZL's Border (多校联合第5场1009)
  • 原文地址:https://www.cnblogs.com/yoona-lin/p/13398344.html
Copyright © 2011-2022 走看看