Kaynağa Gözat

fix: 修改折线图配置

MTrun 3 yıl önce
ebeveyn
işleme
f25ec3d6a7

+ 1 - 1
src/packages/components/Charts/Bars/BarCommon/config.ts

@@ -54,7 +54,7 @@ export const option = {
 export default class Config extends publicConfig
   implements CreateComponentType {
   public key = BarCommonConfig.key
-  public chartConfig = omit(cloneDeep(BarCommonConfig), ['node'])
+  public chartConfig = omit(cloneDeep(BarCommonConfig), ['node', 'conNode'])
   // 图表配置项
   public option = echartOptionProfixHandle(option, includes)
 }

+ 1 - 1
src/packages/components/Charts/Bars/BarCrossrange/config.ts

@@ -54,7 +54,7 @@ export const option = {
 export default class Config extends publicConfig
   implements CreateComponentType {
   public key: string = BarCrossrangefig.key
-  public chartConfig = omit(cloneDeep(BarCrossrangefig), ['node'])
+  public chartConfig = omit(cloneDeep(BarCrossrangefig), ['node', 'conNode'])
   // 图表配置项
   public option = echartOptionProfixHandle(option, includes)
 }

+ 8 - 1
src/packages/components/Charts/Lines/LineCommon/config.ts

@@ -6,6 +6,13 @@ import omit from 'lodash/omit'
 export const includes = ['legend', 'xAxis', 'yAxis']
 
 const option = {
+  tooltip: {
+    show: true,
+    trigger: 'axis',
+    axisPointer: {
+      type: 'line'
+    }
+  },
   legend: {
     show: true
   },
@@ -60,7 +67,7 @@ const option = {
 export default class Config extends publicConfig
   implements CreateComponentType {
   public key: string = LineCommonConfig.key
-  public chartConfig = omit(LineCommonConfig, ['node'])
+  public chartConfig = omit(LineCommonConfig, ['node', 'conNode'])
   // 图表配置项
   public option = echartOptionProfixHandle(option, includes)
 }

+ 48 - 44
src/packages/components/Charts/Lines/LineGradientSingle/config.ts

@@ -6,54 +6,58 @@ import omit from 'lodash/omit'
 
 export const includes = ['legend', 'xAxis', 'yAxis']
 
-const options = echartOptionProfixHandle(
-  {
-    legend: {
-      show: true
-    },
-    xAxis: {
-      show: true,
-      type: 'category',
-      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
-    },
-    yAxis: {
-      show: true,
-      type: 'value'
-    },
-    series: [
-      {
-        name: 'data1',
-        type: 'line',
-        smooth: false,
-        lineStyle: {
-          normal: {
-            width: 3
-          }
-        },
-        areaStyle: {
-          opacity: 0.8,
-          color: new graphic.LinearGradient(0, 0, 0, 1, [
-            {
-              offset: 0,
-              color: 'rgba(25,163,223,.5)'
-            },
-            {
-              offset: 1,
-              color: 'rgba(25,163,223, 0)'
-            }
-          ])
-        },
-        data: [120, 200, 150, 80, 70, 110, 130]
-      }
-    ]
+const options = {
+  legend: {
+    show: true
+  },
+  tooltip: {
+    show: true,
+    trigger: 'axis',
+    axisPointer: {
+      type: 'line'
+    }
+  },
+  xAxis: {
+    show: true,
+    type: 'category',
+    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
   },
-  includes
-)
+  yAxis: {
+    show: true,
+    type: 'value'
+  },
+  series: [
+    {
+      name: 'data1',
+      type: 'line',
+      smooth: false,
+      lineStyle: {
+        normal: {
+          width: 3
+        }
+      },
+      areaStyle: {
+        opacity: 0.8,
+        color: new graphic.LinearGradient(0, 0, 0, 1, [
+          {
+            offset: 0,
+            color: 'rgba(25,163,223,.5)'
+          },
+          {
+            offset: 1,
+            color: 'rgba(25,163,223, 0)'
+          }
+        ])
+      },
+      data: [120, 200, 150, 80, 70, 110, 130]
+    }
+  ]
+}
 
 export default class Config extends publicConfig
   implements CreateComponentType {
   public key: string = LineGradientSingleConfig.key
-  public chartConfig = omit(LineGradientSingleConfig, ['node'])
+  public chartConfig = omit(LineGradientSingleConfig, ['node', 'conNode'])
   // 图表配置项
-  public option = options
+  public option = echartOptionProfixHandle(options, includes)
 }

+ 8 - 1
src/packages/components/Charts/Lines/LineGradients/config.ts

@@ -10,6 +10,13 @@ const option = {
   legend: {
     show: true
   },
+  tooltip: {
+    show: true,
+    trigger: 'axis',
+    axisPointer: {
+      type: 'line'
+    }
+  },
   xAxis: {
     show: true,
     type: 'category',
@@ -78,7 +85,7 @@ const option = {
 export default class Config extends publicConfig
   implements CreateComponentType {
   public key: string = LineGradientsConfig.key
-  public chartConfig = omit(LineGradientsConfig, ['node'])
+  public chartConfig = omit(LineGradientsConfig, ['node', 'conNode'])
   // 图表配置项
   public option = echartOptionProfixHandle(option, includes)
 }

+ 1 - 1
src/packages/components/Charts/Pies/PieCommon/config.ts

@@ -54,7 +54,7 @@ const option = {
 export default class Config extends publicConfig implements CreateComponentType {
   public key: string = PieCommonConfig.key
 
-  public chartConfig = omit(PieCommonConfig, ['node'])
+  public chartConfig = omit(PieCommonConfig, ['node', 'conNode'])
 
   // 图表配置项
   public option = echartOptionProfixHandle(option, includes)