plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Incorrect fill rendering caused by gaps in data

Open acarapetis opened this issue 6 years ago • 7 comments

I'm using Plotly.js to display some time series data with the following relevant properties:

  • Large gaps in the data, and
  • Non-symmetric uncertainty (i.e. each data point has min,avg,max values).

I'm attempting to plot this by adapting this example, but I seem to have come across a bug: when using data with gaps (and connectgaps: false) at the same time as fill: 'tonexty', the gaps cause the fill to be drawn incorrectly: screenshot from 2018-06-14 15-28-40

(The section of data at the very end of the graph is rendered correctly, but everything before the last gap is messed up.) For a simple example that reproduces this issue, see this codepen.

Interestingly, adding fill: 'tozeroy' to the bottom trace seems to resolve the obviously broken aspect of this issue: screenshot from 2018-06-14 15-39-04

I would still argue that the expected behaviour is that connectgaps: false should result in no fill crossing the gaps.

acarapetis avatar Jun 14 '18 05:06 acarapetis

Confirmed, thanks @acarapetis - and the pared-down codepen is much appreciated! Seems to be a problem specifically with gaps in the lower trace.

I'm probably going to need to muck with fills for #1217, perhaps I can fix this at the same time (along with the many other fill bugs)

alexcjohnson avatar Jun 14 '18 19:06 alexcjohnson

We have similar similar issue with two data series that should look like one, continuous data series. We use fill: 'tozeroy', one series ends with many nulls, one series starts with many nulls.

Effect as shown below:

screenshot 2018-07-31 15 21 11

yarl avatar Jul 31 '18 11:07 yarl

I encountered a similar problem and as @acarapetis mentioned adding fill: 'tozeroy' to the bottom trace mitigated the problem for me in combination with fillcolor: 'transparent' for the bottom trace. Also mapping the null values to some very small number (-99999999) to "pinch" the area off worked for me.

nickrussler avatar Nov 29 '19 22:11 nickrussler

Any update on this issue in the meantime?

I encountered a similar problem and as @acarapetis mentioned adding fill: 'tozeroy' to the bottom trace mitigated the problem for me in combination with fillcolor: 'transparent' for the bottom trace. Also mapping the null values to some very small number (-99999999) to "pinch" the area off worked for me.

The workaround above does somehow mitigate the problem. However, the gaps are also filled: grafik Any idea on how to avoid that?

jhannink avatar Apr 24 '20 13:04 jhannink

I was wondering if there is an update regarding this bug. I am still facing this issue in plotly==5.14.1

leoyala avatar May 10 '23 15:05 leoyala

I am also having this issue still, any update on this?

Noahkoole avatar Dec 29 '23 11:12 Noahkoole

We are also experiencing this issue. The fill options does not respect gaps, and will fill across them. We have been using a workaround for a while, which is basically to add a graph for each continuous part of the data.

Is anyone looking in on this?

Brax94 avatar Feb 19 '24 16:02 Brax94

Same problem here using fill="tonexty" to fill between to lines with data gaps being unwillingly filled.

Using plotly-python on plotly==5.18.0

faebebin avatar Feb 28 '24 17:02 faebebin

Is there any progress on this?

wbeardall avatar Apr 02 '24 12:04 wbeardall