Alsmile 1 年之前
父節點
當前提交
d031fb0e48
共有 1 個文件被更改,包括 523 次插入23 次删除
  1. 523 23
      src/services/echarts.ts

+ 523 - 23
src/services/echarts.ts

@@ -3681,6 +3681,11 @@ export const charts = [
                   itemStyle: {
                     color: '#0c56eb',
                   },
+                  pointer: {
+                    itemStyle: {
+                      borderWidth: 0,
+                    },
+                  },
                   data: [{ value: 70 }],
                 },
               ],
@@ -3708,7 +3713,7 @@ export const charts = [
         },
       },
       {
-        name: '渐变仪表盘',
+        name: '圆盘仪表盘',
         icon: 'l-dashboard-chart',
         data: {
           width: 300,
@@ -3898,28 +3903,26 @@ export const charts = [
                     },
                   ],
                   itemStyle: {
-                    normal: {
-                      color: {
-                        colorStops: [
-                          {
-                            offset: 0,
-                            color: '#23A6FF',
-                          },
-                          {
-                            offset: 1,
-                            color: 'rgba(17, 90, 233, 0.21)  ',
-                          },
-                        ],
-                        x: 0,
-                        y: 0,
-                        x2: 0,
-                        y2: 1,
-                        type: 'linear',
-                        global: false,
-                      },
-                      opacity: 0.5,
-                      borderWidth: 0,
+                    color: {
+                      colorStops: [
+                        {
+                          offset: 0,
+                          color: '#23A6FF',
+                        },
+                        {
+                          offset: 1,
+                          color: 'rgba(17, 90, 233, 0.21)  ',
+                        },
+                      ],
+                      x: 0,
+                      y: 0,
+                      x2: 0,
+                      y2: 1,
+                      type: 'linear',
+                      global: false,
                     },
+                    opacity: 0.5,
+                    borderWidth: 0,
                   },
                 },
               ],
@@ -4108,7 +4111,504 @@ export const charts = [
                       action: 5,
                       params: '',
                       value:
-                        "meta2d.setValue({'echarts.option.series.1.axisLine.lineStyle.color.0.0': pen.echarts.option.series.1.data.0.value/100});",
+                        "meta2d.setValue({id:pen.id,'echarts.option.series.1.axisLine.lineStyle.color.0.0': pen.echarts.option.series.1.data.0.value/100});",
+                      targetType: 'id',
+                      props: [],
+                      input: '',
+                    },
+                  ],
+                },
+              ],
+            },
+          ],
+          props: {
+            custom: [
+              {
+                key: 'echarts',
+                label: 'echarts配置',
+                type: 'code',
+              },
+            ],
+          },
+        },
+      },
+      {
+        name: '蓝色科技1',
+        icon: 'l-dashboard-chart',
+        data: {
+          width: 300,
+          height: 300,
+          disableAnchor: true,
+          externElement: true,
+          name: 'echarts',
+          echarts: {
+            option: {
+              fontSize: 10,
+              tooltip: {
+                formatter: '{a} <br/>{b} : {c}%',
+              },
+              series: [
+                {
+                  type: 'gauge',
+                  radius: '98%',
+                  splitNumber: 10,
+                  axisLine: {
+                    lineStyle: {
+                      color: [
+                        [0.58, '#468EFD'],
+                        [1, 'rgba(107,157,215,.25)'],
+                      ],
+                      width: 8,
+                    },
+                  },
+                  axisLabel: {
+                    color: '#4d5bd1',
+                    distance: 16,
+                  },
+                  axisTick: {
+                    distance: 16,
+                    splitNumber: 5,
+                    lineStyle: {
+                      color: '#468EFD',
+                      width: 1,
+                    },
+                    length: 8,
+                  },
+                  splitLine: {
+                    distance: 16,
+                    length: 16,
+                    lineStyle: {
+                      color: '#468EFD',
+                    },
+                  },
+                  itemStyle: {
+                    show: false,
+                  },
+                  detail: {
+                    offsetCenter: [0, 50],
+                    textStyle: {
+                      padding: [0, 0, 0, 0],
+                      fontSize: 18,
+                      fontWeight: '700',
+                      color: '#468EFD',
+                    },
+                  },
+
+                  data: [
+                    {
+                      value: 58,
+                    },
+                  ],
+                  pointer: {
+                    length: '75%',
+                    radius: '20%',
+                    width: 5,
+                    itemStyle: {
+                      borderWidth: 0,
+                    },
+                  },
+                  animationDuration: 4000,
+                },
+              ],
+            },
+            replaceMode: ReplaceMode.Replace,
+          },
+          realTimes: [
+            {
+              key: 'echarts.option.series.0.data.0.value',
+              label: '值',
+              type: 'integer',
+              enableMock: true,
+              mock: '30-80',
+              triggers: [
+                {
+                  name: '触发器1',
+                  conditionType: 'and',
+                  conditions: [
+                    { type: '', operator: '!=', valueType: '', value: '-1' },
+                  ],
+                  actions: [
+                    {
+                      action: 5,
+                      params: '',
+                      value:
+                        "meta2d.setValue({id:pen.id,'echarts.option.series.0.axisLine.lineStyle.color.0.0': pen.echarts.option.series.0.data.0.value/100});",
+                      targetType: 'id',
+                      props: [],
+                      input: '',
+                    },
+                  ],
+                },
+              ],
+            },
+          ],
+          props: {
+            custom: [
+              {
+                key: 'echarts',
+                label: 'echarts配置',
+                type: 'code',
+              },
+            ],
+          },
+        },
+      },
+      {
+        name: '蓝色科技2',
+        icon: 'l-dashboard-chart',
+        data: {
+          width: 300,
+          height: 300,
+          disableAnchor: true,
+          externElement: true,
+          name: 'echarts',
+          echarts: {
+            option: {
+              fontSize: 10,
+              tooltip: {
+                formatter: '{a} <br/>{b} : {c}%',
+              },
+              series: [
+                {
+                  type: 'gauge',
+                  radius: '60%',
+                  splitNumber: 10,
+                  axisLine: {
+                    lineStyle: {
+                      color: [
+                        [0.58, '#468EFD'],
+                        [1, 'rgba(107,157,215,.25)'],
+                      ],
+                      width: 8,
+                    },
+                  },
+                  axisLabel: {
+                    color: '#4d5bd1',
+                    distance: 16,
+                  },
+                  axisTick: {
+                    distance: -50,
+                    splitNumber: 5,
+                    lineStyle: {
+                      color: '#468EFD',
+                      width: 1,
+                    },
+                    length: 8,
+                  },
+                  splitLine: {
+                    distance: -58,
+                    length: 16,
+                    lineStyle: {
+                      color: '#468EFD',
+                    },
+                  },
+                  itemStyle: {
+                    show: false,
+                  },
+                  detail: {
+                    offsetCenter: [0, 50],
+                    textStyle: {
+                      padding: [0, 0, 0, 0],
+                      fontSize: 18,
+                      fontWeight: '700',
+                      color: '#468EFD',
+                    },
+                  },
+                  data: [
+                    {
+                      value: 58,
+                    },
+                  ],
+                  pointer: {
+                    length: '75%',
+                    radius: '20%',
+                    width: 5,
+                    itemStyle: {
+                      borderWidth: 0,
+                    },
+                  },
+                  animationDuration: 4000,
+                },
+              ],
+            },
+            replaceMode: ReplaceMode.Replace,
+          },
+          realTimes: [
+            {
+              key: 'echarts.option.series.0.data.0.value',
+              label: '值',
+              type: 'integer',
+              enableMock: true,
+              mock: '30-80',
+              triggers: [
+                {
+                  name: '触发器1',
+                  conditionType: 'and',
+                  conditions: [
+                    { type: '', operator: '!=', valueType: '', value: '-1' },
+                  ],
+                  actions: [
+                    {
+                      action: 5,
+                      params: '',
+                      value:
+                        "meta2d.setValue({id:pen.id,'echarts.option.series.0.axisLine.lineStyle.color.0.0': pen.echarts.option.series.0.data.0.value/100});",
+                      targetType: 'id',
+                      props: [],
+                      input: '',
+                    },
+                  ],
+                },
+              ],
+            },
+          ],
+          props: {
+            custom: [
+              {
+                key: 'echarts',
+                label: 'echarts配置',
+                type: 'code',
+              },
+            ],
+          },
+        },
+      },
+      {
+        name: '蓝色科技3',
+        icon: 'l-dashboard-chart',
+        data: {
+          width: 300,
+          height: 300,
+          disableAnchor: true,
+          externElement: true,
+          name: 'echarts',
+          echarts: {
+            option: {
+              fontSize: 10,
+              tooltip: {
+                formatter: '{a} <br/>{b} : {c}%',
+              },
+              series: [
+                {
+                  name: '最外部进度条',
+                  type: 'gauge',
+                  radius: '99%',
+                  z: 6,
+                  axisLine: {
+                    lineStyle: {
+                      color: [
+                        [
+                          0.4,
+                          {
+                            colorStops: [
+                              {
+                                offset: 0,
+                                color: 'rgba(145,207,255,0)',
+                              },
+                              {
+                                offset: 0.5,
+                                color: 'rgba(145,207,255,0.2)',
+                              },
+                              {
+                                offset: 1,
+                                color: 'rgba(145,207,255,1)',
+                              },
+                            ],
+                            x: 0,
+                            y: 1,
+                            x2: 0,
+                            y2: 0,
+                            type: 'linear',
+                            global: false,
+                          },
+                        ],
+                        [1, 'rgba(28,128,245,.0)'],
+                      ],
+                      width: 3,
+                    },
+                  },
+                  axisLabel: {
+                    show: false,
+                  },
+                  axisTick: {
+                    show: false,
+                  },
+                  splitLine: {
+                    show: false,
+                  },
+                  pointer: {
+                    show: false,
+                  },
+                  detail: {
+                    offsetCenter: [0, 2],
+                    textStyle: {
+                      padding: [0, 0, 0, 0],
+                      fontSize: 16,
+                      fontWeight: 400,
+                      color: '#EDFFFD',
+                    },
+                  },
+                  data: [
+                    {
+                      value: 40,
+                    },
+                  ],
+                  animationDuration: 4000,
+                },
+                {
+                  name: '半透明仪表盘',
+                  type: 'gauge',
+                  radius: '80%',
+                  z: 4,
+                  splitNumber: 10,
+                  axisLine: {
+                    lineStyle: {
+                      color: [
+                        [
+                          0.4,
+                          {
+                            colorStops: [
+                              {
+                                offset: 0,
+                                color: 'rgba(145,207,255,0)',
+                              },
+                              {
+                                offset: 0.5,
+                                color: 'rgba(145,207,255,0.1)',
+                              },
+                              {
+                                offset: 1,
+                                color: 'rgba(145,207,255,0.3)',
+                              },
+                            ],
+                            x: 0,
+                            y: 1,
+                            x2: 0,
+                            y2: 0,
+                            type: 'linear',
+                            global: false,
+                          },
+                        ],
+                        [1, 'rgba(28,128,245,.0)'],
+                      ],
+                      width: 60,
+                    },
+                  },
+                  axisLabel: {
+                    show: false,
+                  },
+                  axisTick: {
+                    show: false,
+                  },
+                  splitLine: {
+                    show: false,
+                  },
+                  itemStyle: {
+                    show: false,
+                  },
+                  detail: {
+                    show: false,
+                  },
+                  data: [
+                    {
+                      value: 40,
+                    },
+                  ],
+                  pointer: {
+                    length: '100%',
+                    radius: '20%',
+                    width: 3,
+                    itemStyle: {
+                      borderWidth: 0,
+                    },
+                  },
+                },
+                {
+                  name: '刻度线',
+                  type: 'gauge',
+                  radius: '80%',
+                  splitNumber: 10,
+                  axisLine: {
+                    lineStyle: {
+                      color: [[1, '#0063E7']],
+                      width: 3,
+                    },
+                  },
+                  axisLabel: {
+                    color: '#69b1ff',
+                    distance: 8,
+                    fontSize: 12,
+                  },
+                  axisTick: {
+                    distance: 6,
+                    splitNumber: 5,
+                    lineStyle: {
+                      color: '#002c8c',
+                      width: 1,
+                    },
+                    length: 4,
+                  },
+                  splitLine: {
+                    distance: 6,
+                    length: 10,
+                    lineStyle: {
+                      color: '#002c8c',
+                      width: 2,
+                    },
+                  },
+                  detail: {
+                    show: false,
+                  },
+                  pointer: {
+                    show: false,
+                  },
+                },
+                {
+                  name: '指针上的圆',
+                  type: 'pie',
+                  z: 5,
+                  radius: ['0%', '20%'],
+                  center: ['50%', '50%'],
+                  label: {
+                    show: false,
+                  },
+                  labelLine: {
+                    show: false,
+                  },
+                  data: [
+                    {
+                      value: 100,
+                      itemStyle: {
+                        color: 'rgb(14,31,73)',
+                        borderWidth: 0,
+                      },
+                    },
+                  ],
+                },
+              ],
+            },
+            replaceMode: ReplaceMode.Replace,
+          },
+          realTimes: [
+            {
+              key: 'echarts.option.series.0.data.0.value',
+              label: '值',
+              type: 'integer',
+              enableMock: true,
+              mock: '30-80',
+              triggers: [
+                {
+                  name: '触发器1',
+                  conditionType: 'and',
+                  conditions: [
+                    { type: '', operator: '!=', valueType: '', value: '-1' },
+                  ],
+                  actions: [
+                    {
+                      action: 5,
+                      params: '',
+                      value:
+                        "let v = pen.echarts.option.series.0.data.0.value;meta2d.setValue({id:pen.id,'echarts.option.series.0.axisLine.lineStyle.color.0.0':v/100,'echarts.option.series.1.axisLine.lineStyle.color.0.0':v/100,'echarts.option.series.1.data.0.value':v});",
                       targetType: 'id',
                       props: [],
                       input: '',