Hi all!
I’m doing a very simple graph in plotly js, but I can’t add a line in the y-axis to mark a zone, like the green line in the image that I manipulated to show the result.
I’m trying to define the line in the shape property but isn’t’ working.
My code is:
Plotly.plot(gd, [{
x: eixoX,
y: eixoY,
mode: 'lines+markers',
type: 'scatter',
name: 'ORS da Sessão',
height:200,
marker: {
color: 'tomato',
size: 16
}
}],
{
shapes: [
{
type: 'line',
x0: 'Thu Jan 1 1970 00:00:00 GMT+0000 (WET)',
y0: 20,
x1: 'Wed Dec 31 3000 00:00:00 GMT+0000 (WET)',
y1: 20,
line: {
color: 'rgb(50, 171, 96)',
width: 4,
dash: 'dashdot'
}
}
]
},
{
yaxis: {
range: [0,40]
}
});
window.onresize = function() {
Plotly.Plots.resize(gd);
};