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

Stacked waterfall charts

Open nicolaskruchten opened this issue 5 years ago • 7 comments

broken off from #2221 ...

Let’s gather up some requirements for stacked waterfalls here, ideally including screenshots of the desired output.

nicolaskruchten avatar Dec 29 '19 16:12 nicolaskruchten

I see at least two variants:

  1. Multiple distinct waterfall traces that must have the same x and measure and sign for all y (could be implemented with a waterfallmode of stack)
  2. The ability for a single trace to have multiple y values (of the same sign) for a given x (could be implemented with no new attributes in principle?)

nicolaskruchten avatar Dec 29 '19 16:12 nicolaskruchten

In principle we could apply the same stacking/overlapping rules we have for bar in both cases... ugly but well-defined.

And for case 1, we would just always use the measure from the first trace in a given subplot, to avoid conflicts.

nicolaskruchten avatar Dec 29 '19 16:12 nicolaskruchten

I like the multiple traces with waterfallmode="stack" as it is consistent with other other trace types.

  1. if the y values are of different sign, we could show something like this: image

  2. We only stack for overlapping x (consistent with bar) and measure

  3. We allow null values for y which prevents the any hover animations

What are your thoughts?

jdb78 avatar Dec 30 '19 16:12 jdb78

Your case 1 above would actually be closer to waterfallmode="relative" to match the current barmode="relative" case... it's kind of ugly but it has a certain logic to it I'll admit :)

nicolaskruchten avatar Jan 07 '20 03:01 nicolaskruchten

Hi Everyone,

I am very interested in the possibility of a Plotly Stacked Waterfall. The image posted by jdb78 is exactly what I am looking for. I think this solution would fill a large gap in Python’s data visualization capabilities and attract more developers to Plotly.

Can you please advise me on how I can make this dream become a reality? :)

Thank you

whippysundew avatar Jun 21 '22 20:06 whippysundew

@whippysundew I think we still need a little more information about the kind of data it would be useful to represent with such a stack, and come to a consensus on the API for this that's most consistent with our other traces such as bar. After that we can look back at previous waterfall PRs such as https://github.com/plotly/plotly.js/pull/3531 to see where the code needs to be amended.

alexcjohnson avatar Jun 27 '22 16:06 alexcjohnson

@alexcjohnson thank you for your insight. Let’s use software sales data as an example with waterfall columns as follows: YTD revenue (+), won business yet to hit revenue (+), net pipeline (pipeline + business at risk, + or -), total projected performance (+). The stack would be helpful to display different regions or lines of business while still representing the total performance. It would be very beneficial to allow positive or negative values in each column - say one region has a positive net pipeline while another is negative. The chart above shows how this can be displayed.

whippysundew avatar Jun 28 '22 13:06 whippysundew

Definitely a useful feature to add, I was trying to showcase the capital returns of multiple companies, so you have initial assets in t0 and final assets in t1, just like the Plotly waterfall example. It would be great if those initial and final bars could be dissagregated into multiple stacked bars. Just a thought.

etiennecelery avatar Jan 13 '23 16:01 etiennecelery

any news on this issue?

NolsN74 avatar Nov 14 '23 12:11 NolsN74

Hi any update on this stacked waterfall chart?

yogeshriyat avatar Mar 26 '24 12:03 yogeshriyat