0

Any idea on how to achieve that ?

Current issue on chart: enter image description here

Where I would like to avoid extra fillings...

Code used:

    i = 'col'
    pos = df[i] >= 0
    above = np.where(pos, df[i], np.nan)
    below = np.where(pos, np.nan, df[i])
    scatter1 = go.Scatter(x=df.index, y=below, fill='tozeroy')
    scatter2 = go.Scatter(x=df.index, y=above, fill='tozeroy')

    fig.add_trace(scatter1, row=4+j, col=1)
    fig.add_trace(scatter2, row=4+j, col=1)
    fig.add_hline(y=0, row=4+j, col=1)
plonfat
  • 413
  • 1
  • 5
  • 10
  • I haven't tested so I leave it as a comment : you can try to set the fallback value to 0 instead of nan, ie. `above = np.where(pos, df[i], 0)` and `below = np.where(pos, 0, df[i])` – EricLavault Jan 14 '22 at 15:23
  • This could work but the issue is that when I scroll the mouse on the line I would have 0 values showed... This is initialy one time series I just splited in half to try to make the conditional fill work correctly.... – plonfat Jan 17 '22 at 07:54

0 Answers0