lilei 4 سال پیش
والد
کامیت
ef205f6c3a
1فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 8 4
      src/views/Home.vue

+ 8 - 4
src/views/Home.vue

@@ -35,7 +35,7 @@
         <chart-line
           style="height: 350px;"
           color="#6C6FBE"
-          :yMax="200"
+          :yMax="yMax"
           yUnit="单"
           :xAxisRotate="resize"
           :xAxisData="XdaysData"
@@ -84,7 +84,7 @@
               style="height: 350px;"
               color="#6C6FBE"
               :xAxisRotate="resize"
-              :yMax="200"
+              :yMax="yMax1"
               yUnit="单"
               :xAxisData="XdaysData"
               :seriesData="washTypeBarData"
@@ -97,7 +97,7 @@
               ref="ChartLine"
               style="height: 350px;"
               color="#6C6FBE"
-              :yMax="200"
+              :yMax="yMax1"
               yUnit="单"
               :xAxisRotate="resize"
               :xAxisData="XdaysData"
@@ -254,6 +254,7 @@ export default {
       curentType: 'thisWeek', // 当前所选时间查询类型
       beginDate: null, // 开始时间
       endDate: null, // 结束时间
+      yMax: 250,
       // 套餐量图表数据
       washCarsChartData: [
         {
@@ -271,6 +272,7 @@ export default {
       // 套餐类型数据
       currentTabChart: 'tab1', // 套餐类型详情数据与变化趋势的tab 默认展示详情数据
       XdaysData: [], // 图表X轴时间集合
+      yMax1: 250,
       // 套餐类型柱状图表数据
       washTypeBarData: [
         {
@@ -420,7 +422,8 @@ export default {
       })
       this.XdaysData = days
       const washTypeData = [kxData, jxData, dlxData]
-      console.log(washTypeData, 'washTypeData')
+      console.log(kxData.concat(jxData).concat(dlxData), 'washTypeData')
+      this.yMax1 = Math.max.apply(null, kxData.concat(jxData).concat(dlxData))
       // 套餐类型柱状图表数据
       this.washTypeBarData.map((item, index) => {
         item.data = washTypeData[index]
@@ -432,6 +435,7 @@ export default {
       // 套餐量图表数据赋值
       this.washCarsChartData[0].data = totalData
       this.washCarsChartData[1].data = useCouponData
+      this.yMax = Math.max.apply(null, totalData.concat(useCouponData))
     },
     //  获取渠道商下的合作商信息
     getSalesChannel () {