Sort Bar Chart by Value

I often like to sort horizontal bar charts by value–showing the largest bar at the top and showing the other bars in descending order. Can you recommend a way to do this in KNIME?

This is in reference to KNIME Beginner’s Luck, Chapter 3, Exercise 3. The exercise doesn’t require sorting the bars, but I would like to be able to show the workclass counts in the bar chart from highest to lowest.

Thank you!

Hi @knime_knewbie

You can more or less replicate what the bar chart node is doing to achieve this.

Let’s say you have a sum function of the bar chart you can also get around this by doing a groupBy and then sort on the sum value descending.

You can then connect a Bar Chart node and don’t use any aggregation:

4 Likes

Hey @knime_knewbie,

while @ArjenEX excellent explanation is absolutely correct, we have received this request already a few times and we have an internal ticket to make this native functionality of the Bar Chart node (internal reference UIEXT-2026). This thread will get updated as soon as the linked ticket is solved. Until then @ArjenEX solution is the way to go.

Greetings,
Daniel

5 Likes

Thank you, that makes sense!

Thank you, Daniel! I’m happy to hear that’s in the works.