Hi all,
I have a graph with data that represents the evaluation of patients in a given date, about a given topic. I need to have two lines, to ease the perception of the evaluation. It’s like in the next figure:
In this case I have setted the x0 to: ‘2018-01-01’, and x1 to : x1: ‘2118-03-31’
Plotly.plot(gd, [{
x: eixoX,
y: eixoY,
mode: 'lines+markers',
type: 'scatter',
// type: 'bar',
name: 'ORS da Sessão',
height: 200,
marker: {
color: 'tomato',
size: 16
}
}], {
shapes: [{
type: 'line',
x0: '2018-01-01',
y0: 25,
x1: '2118-03-31',
y1: 25,
line: {
color: 'red',
width: 2
}
}, {
type: 'line',
x0: '2018-01-01',
y0: 36,
x1: '2118-03-31',
y1: 36,
line: {
color: 'blue',
width: 2
}
}]
}, {
yaxis: {
range: [0, 40]
}
});
Where eixoX is an array of dates.
But I need this to work for many years, so I need to extend the x0 and x1, to 3000, for instance, but the graph turns into something ridiculous as in the next figure
How can I set the x0 and x1 according to the eixoX values?
I would also like to have the lines more centered in the graph and not in the edges (having more values up and down)
Thanks