Alsmile 1 år sedan
förälder
incheckning
c7f0b858fd
2 ändrade filer med 97 tillägg och 12 borttagningar
  1. 1 1
      index.html
  2. 96 11
      src/services/echarts.ts

+ 1 - 1
index.html

@@ -27,7 +27,7 @@
       href="//at.alicdn.com/t/c/font_4042197_dopqcs38fz5.css"
       rel="stylesheet"
     />
-    <script src="//at.alicdn.com/t/c/font_4042197_4dwahu3kqx3.js"></script>
+    <script src="//at.alicdn.com/t/c/font_4042197_8nkauko228g.js"></script>
   </head>
   <body>
     <div id="app"></div>

+ 96 - 11
src/services/echarts.ts

@@ -959,7 +959,44 @@ export const charts = [
               series: [
                 {
                   type: 'bar',
-                  data: [40, 20, 90, 60, 70, 80],
+                  data: [
+                    {
+                      value: 40,
+                      itemStyle: {
+                        color: '#6851f1',
+                      },
+                    },
+                    {
+                      value: 20,
+                      itemStyle: {
+                        color: '#09bcb7',
+                      },
+                    },
+                    {
+                      value: 90,
+                      itemStyle: {
+                        color: '#f5804d',
+                      },
+                    },
+                    {
+                      value: 60,
+                      itemStyle: {
+                        color: '#0c56eb',
+                      },
+                    },
+                    {
+                      value: 70,
+                      itemStyle: {
+                        color: '#6851f1',
+                      },
+                    },
+                    {
+                      value: 80,
+                      itemStyle: {
+                        color: '#09bcb7',
+                      },
+                    },
+                  ],
                 },
               ],
             },
@@ -967,42 +1004,90 @@ export const charts = [
           },
           realTimes: [
             {
-              key: 'echarts.option.series.0.data.0',
+              key: 'echarts.option.series.0.data.0.value',
               label: '1月',
               type: 'float',
               enableMock: true,
               mock: '10-40',
+              triggers: [
+                {
+                  name: '触发器1',
+                  conditionType: 'and',
+                  conditions: [
+                    {
+                      type: '',
+                      operator: '>',
+                      valueType: '',
+                      value: '20',
+                    },
+                  ],
+                  actions: [
+                    {
+                      action: 1,
+                      params: '',
+                      value: {
+                        'echarts.option.series.0.data.0.itemStyle.color':
+                          '#ff4000',
+                      },
+                      targetType: 'id',
+                    },
+                  ],
+                },
+                {
+                  name: '触发器2',
+                  conditionType: 'and',
+                  conditions: [
+                    {
+                      type: '',
+                      operator: '<=',
+                      valueType: '',
+                      value: '20',
+                    },
+                  ],
+                  actions: [
+                    {
+                      action: 1,
+                      params: '',
+                      value: {
+                        'echarts.option.series.0.data.0.itemStyle.color':
+                          '#6851f1',
+                      },
+                      targetType: 'id',
+                    },
+                  ],
+                },
+              ],
             },
             {
-              key: 'echarts.option.series.0.data.1',
+              key: 'echarts.option.series.0.data.1.value',
               label: '2月',
               type: 'float',
               enableMock: true,
               mock: '0-50',
             },
             {
-              key: 'echarts.option.series.0.data.2',
+              key: 'echarts.option.series.0.data.2.value',
               label: '3月',
               type: 'float',
               enableMock: true,
               mock: '0-50',
             },
             {
-              key: 'echarts.option.series.0.data.3',
+              key: 'echarts.option.series.0.data.3.value',
               label: '4月',
               type: 'float',
               enableMock: true,
               mock: '20-60',
             },
             {
-              key: 'echarts.option.series.0.data.4',
+              key: 'echarts.option.series.0.data.4.value',
               label: '5月',
               type: 'float',
               enableMock: true,
               mock: '0-80',
             },
             {
-              key: 'echarts.option.series.0.data.5',
+              key: 'echarts.option.series.0.data.5.value',
               label: '6月',
               type: 'float',
               enableMock: true,
@@ -3114,7 +3199,7 @@ export const charts = [
       },
       {
         name: '自定义桑基图',
-        icon: 'l-sangshentu',
+        icon: 'l-zidingyisangjitu',
         data: {
           width: 400,
           height: 500,
@@ -4415,7 +4500,7 @@ export const charts = [
     list: [
       {
         name: '中国地图',
-        icon: 'l-line-chart',
+        icon: 'l-earth',
         data: {
           name: 'echarts',
           width: 500,
@@ -4571,7 +4656,7 @@ export const charts = [
       },
       {
         name: '湖北地图',
-        icon: 'l-line-chart',
+        icon: 'l-hubei',
         data: {
           name: 'echarts',
           width: 500,
@@ -4749,7 +4834,7 @@ export const charts = [
       },
       {
         name: '地图·流量',
-        icon: 'l-line-chart',
+        icon: 'l-dituliuliang',
         data: {
           name: 'echarts',
           width: 500,