Funnel charts
See original GitHub issueFunnel charts are kind of interesting because they’re kind of like stacked bar charts, with variable width bars, often with sloping sides, which makes for the potential for double-encoding. A standard stacked bar chart has each segment with the same width, and the height of the segment encodes the datum. On the other extreme you can have bars where each are the same height, and the width encodes the datum, like this: https://www.amcharts.com/demos/funnel-chart/
In both of those cases, the area is proportional to the datum. If you start sloping the sides, then the area no longer matches the datum and it’s just the height: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/funnel/
So we could maybe add some options to bar
to make the version without sloping sides, but it may make more sense to create a new trace type here. We’ll want some special legend and color handling, as well as some computations for hovertemplate like ‘percentage of total’ and ‘percentage difference with previous stage’ etc.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:57 (56 by maintainers)
Top GitHub Comments
Ok for one funnel per trace. It’s very common to want each bar a different color however (much more than to segment each bar like in the image above) so I would want built in support for this, like in pie.
@archmoj I gave your https://github.com/plotly/plotly.js/compare/fix3777-textinfo-waterfall-fin...funnel-new-proto a first look. It’s looking pretty good!
I only noticed two “major” things:
axis.visible
logic https://github.com/plotly/plotly.js/compare/fix3777-textinfo-waterfall-fin...funnel-new-proto#commitcomment-33322847textinfo
formatting usingAxes.tickText
(which also applies to https://github.com/plotly/plotly.js/pull/3790/) https://github.com/plotly/plotly.js/compare/fix3777-textinfo-waterfall-fin...funnel-new-proto#commitcomment-33323818Once these are addressed, please PR away 🚀 The other comments are minor.