Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make legend order match stacked bar order #3118

Closed
Tracked by #57707
kevinkluge opened this issue Feb 20, 2015 · 17 comments
Closed
Tracked by #57707

make legend order match stacked bar order #3118

kevinkluge opened this issue Feb 20, 2015 · 17 comments
Labels
Feature:Lens Feature:Vis Editor Visualization editor issues Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@kevinkluge
Copy link
Member

From what I've seen, when K4 renders a stacked bar in some top-bottom color order (e.g., red, yellow, green), the legend is listed in the opposite top-bottom order (e.g. green, yellow, red). Right now, it's easy to see the two orderings are different, but it's not so easy to see that they are opposite. As a result, moving from bar to legend turns into a matching game, which can be even more annoying if the colors are close together or you have some condition that makes distinguishing colors difficult.

I'd like to see the legend listed in the same top-bottom order as the bars.

@rashidkpc
Copy link
Contributor

I actually wonder if instead of making the legend the same order as the bars, if we shouldn't just sort alphabetically how we display both the legend and the bars.

Also, when a bar is hovered, we should be highlighting the legend value that corresponds to it.

@rashidkpc rashidkpc added release_note:enhancement good first issue low hanging fruit Feature:Vislib Vislib chart implementation labels Feb 20, 2015
@farracha
Copy link

I find it very annoying when the "top" elements on a date histogram bucketing does not show ordered on the legend. I believe the legend shows the results as they appear on the first bucket and not as a "whole" of all buckets.

@w33ble
Copy link
Contributor

w33ble commented Feb 27, 2015

Also, when a bar is hovered, we should be highlighting the legend value that corresponds to it.

Most likely another issue, but a big +1 from me - I always try to use the charts this way

@jthomassie
Copy link

• The stacked charts are rendered bottom up with the largest-value series at the bottom and smallest-value series at the top.
• The legend renders in a top down direction so that the largest value series is at the top, and this ideally reveals to the "answer" to your query or aggregation of the data.

For example, if you "Split Bars" on top 5 @tags, the legend shows the answer at the top:

screen shot 2015-02-27 at 11 22 26 am

If you split on bottom 5 @tags, the legend shows the answer at the top:

screen shot 2015-02-27 at 11 22 49 am

@jthomassie
Copy link

Agreed, hovering over a bar segment should highlight the legend. This was the behavior at some point, and should be restored.

@thedataist
Copy link

+1 bar charts and legends should have the option to be in the same order, particularly for large numbers of entries in the legend

@rashidkpc rashidkpc removed the good first issue low hanging fruit label Mar 25, 2015
@marcinkubica
Copy link

@rashidkpc Actually alphabetical sort for the legend is not always the best way to show something. Ideally it should be possible to choose the order.

For the time being it seems there's no other option if I want to have legend sorted as I please but to add numbers to the strings ie 1_something_A 2_something_C 3_something_B and sort this way to have them ordered 1,2,3. And this also doesn't always work as expected :-]

Pretty lame but how to do it otherwise?

@samuelmr
Copy link

I don't mind the ordering of the legend being opposite to the order of bar stacking. Somehow I find it quite natural that the first items appear in the bottom of the bars but on top of the legend.

However, the current ordering of legend doesn't work well if all the bars don't contain identical sub aggregation items. In the screenshot, the ordering of Split bars is set to alphabetical (term), but the whole legend is not sorted alpabetically.
screen shot 2015-10-25 at 19 52 39
(Also, the bar stack ordering is not really alphabetical in all cases. There's a bar which has terms Eating, Transporting a child and Food preparation in that order.)

(I tried both 4.2.0 beta and 4.3.0 snapshot.)

Should I open a new ticket (or two)?

@marcinkubica
Copy link

A forgotten request or any chance to make it happen in 5.x ? xD (that is to have also ability to order legend by user)

@spalger spalger added the P3 label Feb 20, 2016
@pemontto
Copy link

👍 for alphabetical ordering. Manual ordering would also be nice

@anhlqn
Copy link
Contributor

anhlqn commented May 5, 2016

Similar to @samuelmr, I don't have a problem with largest to smallest from bottom up for bars and topdown for legends. My issue with Kibana 4.5.0 and ES 2.3.0 is that with any Date Histogram + Split bars charts, both bars and legends are just a mess as you can see below

2016-05-02 10-16-36

Sometimes largest values are at the bottom (pink), while for some bars, smaller values (blue) are at the bottom. The pink value on legends are at 12th order which makes no sense when related to the bars.

Ordering works fine if we do not use the split bars in visualization. I'm not sure if it could slow down Kibana, but I recommend that there are options to sort legends either by the total values during the timeframe or by the latest value - the last bar. And I hope the bars display nicely as @jthomassie post.

Right now in my dept., anyone who looks at these visualizations gets confused with such mismatches.

@anhlqn
Copy link
Contributor

anhlqn commented Jul 17, 2016

Any update on this? I'm still having this issue on Kibana 4.5.1.

@simianhacker
Copy link
Member

This is super confusing, I know in visualizations I create (not Kibana) I always make the stacking order match the legend. This is very confusing for new users learning how to use Kibana.

@tbragin tbragin added the Feature:Visualizations Generic visualization features (in case no more specific feature label is available) label Nov 9, 2016
@epixa epixa removed the P3 label Apr 25, 2017
@timroes timroes added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 16, 2018
@legrego
Copy link
Member

legrego commented May 5, 2020

Had a user come across this in the discussion boards today: https://discuss.elastic.co/t/sorting-issue-on-keyword/231133

@michaelpietzsch
Copy link

michaelpietzsch commented Jan 18, 2021

Is there any update on this??

@ghudgins ghudgins added Feature:Lens Feature:Vis Editor Visualization editor issues and removed Feature:Vislib Vislib chart implementation labels Oct 28, 2021
@ghudgins ghudgins removed the discuss label Oct 28, 2021
@ghudgins
Copy link
Contributor

+1 - another case...showing dates (like "years") in the legend

image

@stratoula
Copy link
Contributor

Closing as duplicate of #86184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens Feature:Vis Editor Visualization editor issues Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests