plotly_express icon indicating copy to clipboard operation
plotly_express copied to clipboard

Fill between two vertical lines but multiple times

Open PaulForInvent opened this issue 4 years ago • 0 comments

Hey, I wonder how I can do that.

I tried it the follwoing way, but it also need very much time if you have a lot of add_vrect to add...

I calculated beforehand the needed start and end positions for each single add_vrect.

But this somehow seems not working as all of the chart is filled...

Maybe is it he time format? My Time format is like: 2021-07-15T01:00:00.000000000.

How can I do this more simpler of without a for loop to be more efficient?

  for index, row in enumerate(first):
       start = row
       end = last[index]

       fig.add_vrect(x0=start, x1=end,
                     annotation_text="decline", annotation_position="top left",
                     fillcolor="green", opacity=0.25, line_width=1)

PaulForInvent avatar Aug 21 '21 08:08 PaulForInvent