Procházet zdrojové kódy

首页交互,图表y轴空间调整

ZhangWenQiang před 5 roky
rodič
revize
86adcc2038

+ 7 - 1
src/components/chart/SmoothLineAndArea.vue

@@ -2,7 +2,8 @@
   <div :style="{ padding: '0 0 0 0' }">
     <v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :padding="padding">
       <v-tooltip />
-      <v-axis />
+      <v-axis dataKey="x"/>
+      <v-axis dataKey="y" :label="IAxisLabel" />
       <v-smooth-line position="x*y" color="#6569F7" shape="smooth" :size="lineSize"/>
       <v-point position="x*y" color="#fff" shape="circle" />
       <!--<v-area position="x*y" color="#D9DBFF" shape="smooth"/>-->
@@ -13,6 +14,10 @@
 <script>
   const DataSet = require('@antv/data-set');
 
+  const IAxisLabel= {
+    offset: 4,
+  }
+
   export default {
     name: 'SmoothLineAndArea',
     props: {
@@ -61,6 +66,7 @@
     data() {
       return {
         lineSize: 6,
+        IAxisLabel
       };
     }
   };

+ 1 - 1
src/views/dashboard/IndexChart.vue

@@ -336,7 +336,7 @@
         seamlessOption:{
           step: 1, // 数值越大速度滚动越快
         },
-        smoothPadding: ['10', '30', '50', '50'],
+        smoothPadding: ['10', '30', '50', '60'],
         barColor: [[ 'l(90) 0:#7D5DF4 1:#5673F8']],
         baseBarColor: [[ 'l(90) 0:#7D5DF4 1:#5673F8']],
         barPadding: ['20', '30', '50', '30'],