CN-525 错误恢复:Y轴数据格式化恢复
This commit is contained in:
@@ -665,71 +665,71 @@ export function handleEchartFontSize (option) {
|
|||||||
const echartLegendFontSize = localStorage.getItem(storageKey.echartLegendFontSize)
|
const echartLegendFontSize = localStorage.getItem(storageKey.echartLegendFontSize)
|
||||||
const echartLabelFontSize = localStorage.getItem(storageKey.echartLabelFontSize)
|
const echartLabelFontSize = localStorage.getItem(storageKey.echartLabelFontSize)
|
||||||
let chartOption = option
|
let chartOption = option
|
||||||
try {
|
const newSeries = []
|
||||||
const newSeries = []
|
const chartType = chartOption.series[0].type
|
||||||
const chartType = chartOption.series[0].type
|
chartOption.series.forEach((series) => {
|
||||||
chartOption.series.forEach((series) => {
|
const seriesNew = {
|
||||||
const seriesNew = {
|
...series,
|
||||||
...series,
|
label: {
|
||||||
|
...series.label,
|
||||||
|
fontSize: echartLabelFontSize
|
||||||
|
},
|
||||||
|
markLine: {
|
||||||
|
...series.markLine,
|
||||||
label: {
|
label: {
|
||||||
...series.label,
|
|
||||||
fontSize: echartLabelFontSize
|
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) {
|
newSeries.push(seriesNew)
|
||||||
console.error(e)
|
})
|
||||||
|
|
||||||
|
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
|
return chartOption
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,12 +145,14 @@ export default {
|
|||||||
xAxis: {
|
xAxis: {
|
||||||
...chartOption.xAxis,
|
...chartOption.xAxis,
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
|
...chartOption.xAxis.axisLabel,
|
||||||
fontSize: echartLabelFontSize
|
fontSize: echartLabelFontSize
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
...chartOption.yAxis,
|
...chartOption.yAxis,
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
|
...chartOption.yAxis.axisLabel,
|
||||||
fontSize: echartLabelFontSize
|
fontSize: echartLabelFontSize
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user