<template>
  <div id="UpdatePassword">
    <el-row>
      <el-col :span="24">
        <div class="container">
          <div class="middle">
<!--            <div class="w_1200">-->
<!--              <span class="title">解决融资</span>-->
<!--              <el-divider ></el-divider>-->
<!--            </div>-->
            <div class="w_12001">
              <div id="myChart6"></div>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import {SolutionResulttwo} from '../../api';
  import echarts from 'echarts/lib/echarts'
  export default {
    name: 'UpdatePassword',
    props: {},
    components: {
    },
    data: () => ({
      photos: [],
      radio1: '0',
      tableData: [],  // 柱形图
      tableData1: [], // 饼图
      chart: null,
      xNum :[],
      yNum :[],
    }),
    created() {
    },
    computed: {},
    methods: {
      handleDetail() {
      },
      back() {
        this.$router.push({
          path: '/',
        })
      },
      rowClass() {
        return 'text-align: center;'
      },
      async all() {
        let myChart = this.$echarts.init(document.getElementById('myChart6'))
        myChart.showLoading();
        const result = await SolutionResulttwo();
        console.log(result)
        if (result.errcode == 0){
          myChart.hideLoading();
          result.data.forEach(item=>{
            this.xNum.push(item.label)
          });
          result.data.forEach(item=>{
            this.yNum.push(item.value)
          });
          myChart.setOption({
            xAxis: {
              type: 'category',
              data: this.xNum,
              axisLabel: {
                interval: 0
              }
            },
            yAxis: {
              type: 'value',
            },
            grid: {
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            series: [
              {
                data: this.yNum,
                type: 'bar',
                name: '柱状图',
                itemStyle: {
                  normal: {
                    color: new echarts.graphic.LinearGradient(
                            0, 0, 0, 1, [{
                              offset: 0,
                              color: '#f25d2d'
                            },
                              {
                                offset: 1,
                                color: '#11ded6'
                              }
                            ])
                  }
                }
              },
              {
                data: this.yNum,
                type: 'line',
                name: '折线图',
                symbolSize: 15, // 控制线条上 点 的大小
                itemStyle : { normal: {label : {show: true}}}
              }
            ],
            // dataZoom: [
            //   {
            //     height: 30,
            //     type: "slider",
            //     show: true, //flase直接隐藏图形
            //     xAxisIndex: [0],
            //     left: "9%", //滚动条靠左侧的百分比
            //     bottom: -5,
            //     start: 0, //滚动条的起始位置
            //     end: 38 //滚动条的截止位置（按比例分割你的柱状图x轴长度）
            //   }
            // ]
          })
        }

      },
    },
    mounted() {
      this.all();
    }
  };
</script>

<style lang="less" scoped>
  #myChart6 {
    width: 1200px;
    height: 700px;
    margin-left: 30px;
  }

  .container {
    /*width: 1920px;*/
    /*height: 1080px;*/
    /*margin: 0 auto;*/
    /*width: 1920px;*/
    /*margin: 0 auto;*/
    //background-color: #f0f6fb;
    //height: 100vh;
    /*overflow-x: hidden;*/

  }

  .header {
    /*height: 100px;*/
    /*width: 1920px;*/
    background: rgba(42, 46, 67, 1);
  }

  .w_1200 {
    width: 1200px;
    margin: 0 auto;
  }
  .middle{
      background-color: white;
  }

  .w_12001 {
    width: 1200px;
    margin: 0 auto;
    background-color: white;
    box-sizing: border-box;
    margin-bottom: 30px;
      height: 100vh;
  }

  .changetab {
    padding-top: 40px;
    padding-left: 376px;
  }

  .changeColor {
    margin-bottom: 70px;
    width: 100px;
    height: 40px;
    background: rgba(233, 2, 29, 1);
    color: #fff;
    font-size: 20px;
    position: relative;
    border: 1px solid rgba(233, 2, 29, 1);
    top: -25px;
    left: 140px;
  }

  /deep/ .el-divider--horizontal {
    display: inline-block;
    width: 90%
  }

  /deep/ .el-radio-button__inner {
    padding: 25px 75px;
    font-family: Source Han Sans SC;
    font-weight: 400;
    font-size: 16px;
    border-color: #e9021d;
  }

  /deep/ .is-active .el-radio-button__inner {
    color: rgba(255, 255, 255, 1);
    background-color: #e9021d;
    border-color: #e9021d;
    box-shadow: none;
  }

  /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border-left: 1px solid red;
  }

  /deep/ .is-active .el-radio-button__inner:hover {
    color: rgba(255, 255, 255, 1);
  }

  /deep/ .el-radio-button__inner:hover {
    color: #e9021d;
  }

  .footer {
    height: 323px;
  }

  .title {
    position: relative;
    top: -20px;
    font-size: 16px;
    font-family: Source Han Sans SC;
    font-weight: bold;
    color: rgba(0, 0, 0, 1);
  }

  /deep/ .el-divider__text {
    font-size: 14px;
    font-family: Source Han Sans SC;
    font-weight: 400;
    color: rgba(233, 2, 29, 1);
    background-color: #f0f6fb;
  }

  /deep/ .el-image__inner--center {
    -ms-transform: none;
    top: 0;
    left: 0;
  }
  .total{
    position: absolute;
    top: 60px;
    left: 440px;
    width: 300px;
    height: 24px;
    font-size:16px;
    font-family:Source Han Sans SC;
    font-weight:400;
    color:rgba(0,0,0,1);
  }
  /deep/ .el-divider__text{
    cursor: pointer;
  }
  /deep/ .el-col-24 {
      background-color: white;
  }
</style>
