3. 基准线位置
leezozz 1/16/2023 echarts
{
type: 'line', // 基准线
markLine: {
silent: true, // 不触发鼠标事件
symbol: '', // 标线两端样式
lineStyle: { // 标线样式
color: '#ED5549',
type: 'dashed'
},
data: [{ // 标线数据
label: {
fontSize: '20px',
color: judgingFontDisplay(props.data.data2)[0] === '盈余'#1679D9' : '#ED5549',
// insideEndBottom
// insideEndTop
// 动态的控制盈余、亏损位置
position: judgingFontDisplay(props.data.data2)[1],
// // 基准线的显示:盈余、亏损
formatter: judgingFontDisplay(props.data.data2)[0],
// 设置基准线的label距离基准线的位置 [横向间距, 纵向间距] !!!!!!!!!!!!!!
distance: [-34, 10]
},
// 基准线的值对应y轴
yAxis: marklineData
}]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27