Hi Team, as discussed with some of you recently, it would be very valueable having the following two extensions to the bar chart:
- Being able to render bar segments (split categories over a bar in the bar chart)
- Provide a custom order of categories, since often alphabetical ordering is not the preferred one.
Thanks
Nico
Hi Nico, I have good news for you - we have just implemented a way to provide custom order for categories. Once defined, it is taken into account not only by the bar chart, but by the rest of the viewers as well, including the spreadsheet.
To set custom category order, right-click on the column header and select Sort | Custom
:
1 Like
Hi Andrew,
That’s great news
Two follow-up questions:
- Is that custom sort order preserved in the layouts?
- Is is specific to a layout or could it be propagated other layouts too? Just think about our ID use-case, where we have multiple layouts in one analysis.
Currently, custom sort order is not saved with the layout, but instead it gets saved along with the data frame (it makes perfect sense to keep the order with the data and not with the visual representation of it, since it affects operations such as sorting and aggregation). All you need to do is associate it with the data frame (see JS snippet below) during the data ingestion:
dataFrame.columns.byName('severity').setCategoryOrder(['Low', 'Medium', 'High']);
Persisting this information as part of a layout might also be a good idea, let us ponder on that. We are also thinking about the best way to connect category order with the semantic type concept, including auto-detection of such types.
Ok thanks for the clarification.
I think one could argue whether it rather belongs to the one or the other, but the bottom line is that in our internal use-case, we would need to handle changes made by the user and write that back somehow to our internal data store (what shouldn’t hopefully be a big deal). On the other hand, we can that way provide a reasonable default in a very easy way, assuming that we can just set that when writing the Dataframe?!