|
|
@@ -1,6 +1,7 @@
|
|
|
import { ref, watch } from "vue";
|
|
|
import { toDecimalFull } from '@/utils/number';
|
|
|
import { getTheme, ThemeEnum } from '@/common/config/theme';
|
|
|
+import { deepMerge } from '@/utils/objHandle'
|
|
|
import { EChartsOption } from 'echarts';
|
|
|
import * as echarts from 'echarts';
|
|
|
|
|
|
@@ -58,7 +59,7 @@ export function handleEchart() {
|
|
|
// 初始化图表配置
|
|
|
const initOptions = () => {
|
|
|
const { datas, times, yestclose, last, min, max, ma5, decimal } = chartData.value;
|
|
|
- options.value = {
|
|
|
+ const option: EChartsOption = {
|
|
|
legend: {
|
|
|
//图例控件,点击图例控制哪些系列不显示
|
|
|
type: 'scroll',
|
|
|
@@ -190,10 +191,7 @@ export function handleEchart() {
|
|
|
],
|
|
|
};
|
|
|
|
|
|
- // 先用 setTimeout 处理,待优化深度合并
|
|
|
- setTimeout(() => {
|
|
|
- options.value = getColors(theme.value);
|
|
|
- }, 0);
|
|
|
+ options.value = deepMerge(option, getColors(theme.value));
|
|
|
};
|
|
|
|
|
|
// 动态更新数据
|