Răsfoiți Sursa

水平线保持红色,趋势线红色

yourname 6 luni în urmă
părinte
comite
1d89436d01

+ 37 - 3
src/client/live/components/stock/components/stock-chart/src/lib/drawing/ChartDrawingTools.ts

@@ -135,10 +135,20 @@ export class ChartDrawingTools {
 
           markLineData.push([{
             coord: [coords.left.x, coords.left.y],
-            symbol: 'none'
+            symbol: 'none',
+            lineStyle: {
+              color: '#0000ff', // 蓝色
+              width: 1,
+              type: 'solid'
+            }
           }, {
             coord: [coords.right.x, coords.right.y],
-            symbol: 'none'
+            symbol: 'none',
+            lineStyle: {
+              color: '#0000ff', // 蓝色
+              width: 1,
+              type: 'solid'
+            }
           }]);
         }
       }
@@ -154,7 +164,31 @@ export class ChartDrawingTools {
           width: 1,
           type: 'solid'
         },
-        data: markLineData
+        data: markLineData.map(item => {
+          // 为趋势线设置蓝色,其他线条设置红色
+          if (Array.isArray(item)) {
+            // 趋势线或趋势延伸线
+            return item.map(point => ({
+              ...point,
+              lineStyle: {
+                color: '#0000ff', // 蓝色
+                width: 1,
+                type: 'solid'
+              }
+            }));
+          } else {
+            // 水平线
+            return {
+              ...item,
+              lineStyle: {
+                color: '#ff0000', // 红色
+                width: 1,
+                type: 'solid',
+                ...item.lineStyle
+              }
+            };
+          }
+        })
       };
     }
 

+ 12 - 3
src/client/mobile/components/stock/components/stock-chart/src/lib/drawing/ChartDrawingTools.ts

@@ -137,10 +137,20 @@ export class ChartDrawingTools {
 
           markLineData.push([{
             coord: [coords.left.x, coords.left.y],
-            symbol: 'none'
+            symbol: 'none',
+            lineStyle: {
+              color: '#0000ff', // 蓝色
+              width: 1,
+              type: 'solid'
+            }
           }, {
             coord: [coords.right.x, coords.right.y],
-            symbol: 'none'
+            symbol: 'none',
+            lineStyle: {
+              color: '#0000ff', // 蓝色
+              width: 1,
+              type: 'solid'
+            }
           }]);
         }
       }
@@ -153,7 +163,6 @@ export class ChartDrawingTools {
         animation: false,
         symbol: ['none', 'none'],
         lineStyle: {
-          color: '#666666', // 暗灰色
           width: 1,
           type: 'solid'
         },