石广澎
2023-11-29 b8dc4ccc6ee580b084aa860e64af2d90d1cb5979
admin-web/src/views/dashboard/components/XYZC.vue
@@ -9,6 +9,7 @@
  </div>
</template>
<script>
import {getGoodsNumByMonth} from '@/api/dashboard'
import * as echarts from 'echarts';
export default {
@@ -75,7 +76,7 @@
            emphasis: {
              focus: 'series',
            },
            data: [320, 332, 301, 334, 320, 332, 301, 334, 320, 332, 301, 334],
            data: [],
            lineStyle: {
              width: 2, // 外边线宽度
              color: '#5BE1FD'// 外边线颜色
@@ -103,7 +104,7 @@
            emphasis: {
              focus: 'series',
            },
            data: [220, 182, 191, 234, 220, 182, 191, 234, 220, 182, 191, 234],
            data: [],
            lineStyle: {
              width: 2, // 外边线宽度
              color: '#FFD15C'// 外边线颜色
@@ -127,6 +128,17 @@
        ],
      };
      this.options && this.myChart.setOption(this.options);
      getGoodsNumByMonth().then(res=>{
        let xAxis0 = []
        let xAxis1 = []
        res.map(item=>{
          xAxis0.push(item.addTotalNum)
          xAxis1.push(item.reduceTotalNum)
        })
        this.options.series[0].data = xAxis0
        this.options.series[1].data = xAxis1
        this.myChart.setOption(this.options);
      })
    },
    changeWidth() {
      this.myChart.resize();