I was able to achieve this in a way that only give x-axis not y-axis when defining in series. When giving y-axis it will display your line horizontally instead of vertically. Below is the code
series: [
{
name: `Max. of RES ${resPeak?.max_production}`,
type: "line",
stack: "Total",
areaStyle: {},
emphasis: {
focus: "series",
},
markLine: {
data: [
{
xAxis: resPeak.max_production > 0 ? resPeakIndex : 0,
label: {
show: true,
formatter:
resPeak.max_production > 0
? `Max. of RES \n${resPeak?.max_production}`
: `Max. of RES \n 0`,
position: "end",
},
lineStyle: {
type: "dotted",
color: "#00008B",
},
symbol: "circle",
},
],
},
},[![enter image description here][1]][1]
]