Extend multicategory axes to more than 2 levels
See original GitHub issueThis is a request to add nested categorical axes. These are often used in “variability charts”, examples of which can be seen here.
There’s a few ways this could be implemented in practice. Rather than passing an array of values for y
the user could pass an object like:
{
"popcorn": ["gourmet", "gourmet", "plain", ...]
"batch": ["large", "small", "large", ...]
...
}
or simply pass a category name / number (1
or "gourmet-large-little"
) and pass the nesting information for the axis in the layout section.
(I was surprised not to find an open issue for this – it’s possible that there is one but I didn’t search using the right terms).
Edit: There is some limited support for this as shown here but it involves hacking the axis together by hand and would be difficult to use in an automated manner.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Multicategory Axis: How many categories are allowed?
Hi there can I use mutlitcategory axis with more than two ... Results with plotly.py at Extend multicategory axes to more than 2...
Read more >How to create a multi level axis | Exceljet
In this video, we'll look at how to build a chart with multi-level axis labels. A multi-level ... You can add more labels...
Read more >Formatting Multilevel Axes Labels with plotly - Stack Overflow
There are two points I fixed. First, I moved the legend to the top of the title to make room for it on...
Read more >Multi-Level Category Labels in Excel Chart - YouTube
The key to creating this type of chart is how you layout your data. The video features a multi-category bar and column chart....
Read more >Create a multi-level category chart in Excel - ExtendOffice
2. Select the data range, click Insert > Insert Column or Bar Chart ... As the above chart shown, there are three-level category...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can someone please comment on the status of this feature or at least tell us where in the source code we need to look to try and add this capability ourselves?
@etpinard, can you give a high level overview of what we would need to change to extend multicategory axis capability? Any help is greatly appreciated.
Thanks
Ok, just opened a draft PR. This is my first contribution, so please let me know if I have to do anything differently. Also, solved the stacking dividers, calling the remove only on the first pass (last/closest to plot axis). Updated the codepen with this fix with the data from #3723, to show the sorting also working as expected.
I hope this is integrated, please keep me posted on the development and next steps!