elastic / elastic-charts

https://elastic.github.io/elastic-charts/storybook
Other
372 stars 120 forks source link

bars gaps and spaces #350

Open AlonaNadler opened 5 years ago

AlonaNadler commented 5 years ago

When you split series in a not stacked chart there are gaps and spaces between the bars, which makes the chart looks bad visually and also the gaps cannot be explained

image

it appears the chart is "saving" space for certain values. In high cardinality data, the top values can be completely different between the x-axis values. so for example in the example above maybe

It would be good the not have these gaps between the bars and reserved the number of places based on the size of the split series, which any value/color can be within them

cc: @flash1293

nickofthyme commented 5 years ago

Thanks for bringing this up. This functionality is by design as each x-Axis ordinal value (i.e. gz, zip, css, etc.) will save room for each of the 12 series in the legend. The spaces represent a null, 0 (zero) or relatively small value for a given series.

That said we are always eager to make enhancements that will promote readability and reduce noise.

Are you proposing that we collapse the spaces where there is no value to show?

flash1293 commented 5 years ago

It feels like there are use cases for both, if you have a low number of series, reserving space for a "zero" value is probably the more readable option, for a high number of series efficiently using the space might make more sense. Maybe a setting on the series spec component?

nickofthyme commented 5 years ago

@flash1293 Great idea I was thinking something similar

AlonaNadler commented 5 years ago

This functionality is by design as each x-Axis ordinal value (i.e. gz, zip, css, etc.) will save room for each of the 12 series in the legend. The spaces represent a null, 0 (zero) or relatively small value for a given series.

What if the field we do the split series is IP (which is high cardinality)? IP can have ten thousand of different Ips. The approach of "saving" spaces for dedicated values will be challenging when it comes to really data were there are more than 5 values

image

nickofthyme commented 5 years ago

@AlonaNadler Ya I can see the use case. I talked with @markov00 and @monfera about how to approach this. We will prioritize accordingly.

markov00 commented 8 months ago

hey @gvnmagni it will be great if you can provide your input here: what we have is "hierarchical" categorical bar chart where each main category has its own group of bars. In some cases some bars are missing (no data/no value). What should we do: always consider each main category with all the available sub-categories (having these empty spaces around) or should we just keep the same order of the subcategories but we can put each sub-categories side-by-side without the need to respect the position of missing sub-categories?

The same principle should/could be applied to small multiples.

gvnmagni commented 8 months ago

I would discern the grouped bars from the small multiple concept. In grouped bars, I think that it probably makes sense to collapse all bars together, especially when we have a lot of them, and it is probably a good idea to choose a number of categories that when exceeded makes those bars to get closer to each other. Five? six? I don't have a specific number in mind, we can try with five and see how it behaves.

In the case of small multiples I am a little reluctant though, since the whole concept of the small multiple is to create identical charts that differ only from the main subject but that lives on the same identical structure. The main goal is comparison and we might lose that if we fill those empty spaces. In that case it's probably better, from my point of view, to leave empty spaces as they are

nickofthyme commented 1 month ago

Another use case I saw today, related to mutual exclusivity of series to each bucket.

Image