Commit dc7aed58 authored by xinzhedeai's avatar xinzhedeai

dp 降雨量 警戒线显示

parent d5b302d3
......@@ -134,7 +134,16 @@ const updateChartData = () => {
symbol: 'none',
data: warningLines.value.map(line => ({
label: {
show: false
show: false, // 确保标签显示
position: 'insideStartTop', // 标签位置:内侧顶部
offset: [0, -5], // 偏移量:向上偏移5px避免重叠
formatter: `${line.name}: {c}mm`, // 格式化显示内容(名称+值+单位)
textStyle: {
color: `#${line.color}`, // 标签颜色与警戒线一致
fontSize: 12,
whiteSpace: 'nowrap' // 禁止文本换行
},
padding: [2, 5] // 增加内边距让文本更清晰
},
name: line.name,
yAxis: line.value,
......@@ -203,7 +212,16 @@ const initChart = () => {
symbol: 'none',
data: warningLines.value.map(line => ({
label: {
show: false
show: false, // 确保标签显示
position: 'insideStartTop', // 标签位置:内侧顶部
offset: [0, -5], // 偏移量:向上偏移5px避免重叠
formatter: `${line.name}: {c}mm`, // 格式化显示内容(名称+值+单位)
textStyle: {
color: `#${line.color}`, // 标签颜色与警戒线一致
fontSize: 12,
whiteSpace: 'nowrap' // 禁止文本换行
},
padding: [2, 5] // 增加内边距让文本更清晰
},
name: line.name,
yAxis: line.value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment