刘洋 8 months ago
parent
commit
2a8e9bd006
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/components/common/china-point-chart/index.vue

+ 7 - 1
src/components/common/china-point-chart/index.vue

@@ -88,6 +88,12 @@ const dataHandle = (data) => {
   }
 };
 const options = computed(() => {
+  let max = props.data?.length
+    ? Math.max.apply(
+        null,
+        (props.data || []).map((item) => item.sopNum)
+      )
+    : 10;
   return {
     backgroundColor: 'transparent',
     // backgroundColor: '#fff',
@@ -151,7 +157,7 @@ const options = computed(() => {
 
     visualMap: {
       min: 0,
-      max: Math.max((props.data || []).map((item) => item.sopNum || 0)) || 10,
+      max: max || 10,
       left: 'left',
       top: 'bottom',
       text: ['高', '低'],