CN-525 echarts图内文字动态调整大小,问题修复:折线图markline标签未显示完全

This commit is contained in:
hyx
2022-05-11 12:37:16 +08:00
parent d8e79b97f7
commit b3f6b5c7ea
2 changed files with 53 additions and 18 deletions

View File

@@ -668,6 +668,7 @@ export function handleEchartFontSize (option) {
const newSeries = [] const newSeries = []
const chartType = chartOption.series[0].type const chartType = chartOption.series[0].type
chartOption.series.forEach((series) => { chartOption.series.forEach((series) => {
if (series.markLine) {
const seriesNew = { const seriesNew = {
...series, ...series,
label: { label: {
@@ -677,11 +678,27 @@ export function handleEchartFontSize (option) {
markLine: { markLine: {
...series.markLine, ...series.markLine,
label: { label: {
...series.markLine.label,
fontSize: echartLabelFontSize fontSize: echartLabelFontSize
} }
} }
} }
newSeries.push(seriesNew) newSeries.push(seriesNew)
} else {
const seriesNew = {
...series,
label: {
...series.label,
fontSize: echartLabelFontSize
},
markLine: {
label: {
fontSize: echartLabelFontSize
}
}
}
newSeries.push(seriesNew)
}
}) })
if (chartType === 'pie') { if (chartType === 'pie') {

View File

@@ -114,6 +114,23 @@ export default {
const newSeries = [] const newSeries = []
const chartType = chartOption.series[0].type const chartType = chartOption.series[0].type
chartOption.series.forEach((series) => { chartOption.series.forEach((series) => {
if (series.markLine) {
const seriesNew = {
...series,
label: {
...series.label,
fontSize: echartLabelFontSize
},
markLine: {
...series.markLine,
label: {
...series.markLine.label,
fontSize: echartLabelFontSize
}
}
}
newSeries.push(seriesNew)
} else {
const seriesNew = { const seriesNew = {
...series, ...series,
label: { label: {
@@ -128,6 +145,7 @@ export default {
} }
} }
newSeries.push(seriesNew) newSeries.push(seriesNew)
}
}) })
if (chartType === 'pie') { if (chartType === 'pie') {