CN-525 错误恢复:Y轴数据格式化恢复

This commit is contained in:
hyx
2022-05-06 16:13:27 +08:00
parent 7b40930c5e
commit 5d19d580d2
2 changed files with 62 additions and 60 deletions

View File

@@ -665,71 +665,71 @@ export function handleEchartFontSize (option) {
const echartLegendFontSize = localStorage.getItem(storageKey.echartLegendFontSize)
const echartLabelFontSize = localStorage.getItem(storageKey.echartLabelFontSize)
let chartOption = option
try {
const newSeries = []
const chartType = chartOption.series[0].type
chartOption.series.forEach((series) => {
const seriesNew = {
...series,
const newSeries = []
const chartType = chartOption.series[0].type
chartOption.series.forEach((series) => {
const seriesNew = {
...series,
label: {
...series.label,
fontSize: echartLabelFontSize
},
markLine: {
...series.markLine,
label: {
...series.label,
fontSize: echartLabelFontSize
},
markLine: {
...series.markLine,
label: {
fontSize: echartLabelFontSize
}
}
}
newSeries.push(seriesNew)
})
if (chartType === 'pie') {
chartOption = {
...chartOption,
legend: {
...chartOption.legend,
textStyle: {
fontSize: echartLegendFontSize
}
},
axisLabel: {
...chartOption.axisLabel,
fontSize: echartLabelFontSize
},
series: newSeries
}
} else {
chartOption = {
...chartOption,
legend: {
...chartOption.legend,
textStyle: {
fontSize: echartLegendFontSize
}
},
xAxis: {
...chartOption.xAxis,
axisLabel: {
fontSize: echartLabelFontSize
}
},
yAxis: {
...chartOption.yAxis,
axisLabel: {
fontSize: echartLabelFontSize
}
},
axisLabel: {
...chartOption.axisLabel,
fontSize: echartLabelFontSize
},
series: newSeries
}
}
} catch (e) {
console.error(e)
newSeries.push(seriesNew)
})
if (chartType === 'pie') {
chartOption = {
...chartOption,
legend: {
...chartOption.legend,
textStyle: {
...chartOption.legend.textStyle,
fontSize: echartLegendFontSize
}
},
axisLabel: {
...chartOption.axisLabel,
fontSize: echartLabelFontSize
},
series: newSeries
}
} else {
chartOption = {
...chartOption,
legend: {
...chartOption.legend,
textStyle: {
...chartOption.legend.textStyle,
fontSize: echartLegendFontSize
}
},
xAxis: {
...chartOption.xAxis,
axisLabel: {
...chartOption.xAxis.axisLabel,
fontSize: echartLabelFontSize
}
},
yAxis: {
...chartOption.yAxis,
axisLabel: {
...chartOption.yAxis.axisLabel,
fontSize: echartLabelFontSize
}
},
axisLabel: {
...chartOption.axisLabel,
fontSize: echartLabelFontSize
},
series: newSeries
}
}
return chartOption
}