question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extend multicategory axes to more than 2 levels

See original GitHub issue

This 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:open
  • Created 6 years ago
  • Reactions:5
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
aaron-kyocommented, Nov 5, 2021

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

2reactions
richardnm-2commented, Sep 27, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found