|
|
@@ -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
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+ })
|
|
|
};
|
|
|
}
|
|
|
|