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

[XY axis] Values on bar charts #101573

Closed
stratoula opened this issue Jun 8, 2021 · 8 comments · Fixed by #106231
Closed

[XY axis] Values on bar charts #101573

stratoula opened this issue Jun 8, 2021 · 8 comments · Fixed by #106231
Assignees
Labels
bug Fixes for quality problems that affect the customer experience discuss Feature:ElasticCharts Issues related to the elastic-charts library Feature:Lens Feature:XYAxis XY-Axis charts (bar, area, line) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@stratoula
Copy link
Contributor

stratoula commented Jun 8, 2021

I create this issue to discuss what we can do to improve the way that the values are depicted on bar charts.
For all the below mentioned cases the Show values switch is set to true (XY axis). Lens behaves differently. The setting to display the values is disabled for histograms.

XY es-charts settings:

displayValueSettings={{
  showValueLabel,
  hideClippedValue: true,
}}

Lens settings:

displayValueSettings: {
   showValueLabel: shouldShowValueLabels && valueLabels !== 'hide',
   isAlternatingValueLabel: false,
   isValueContainedInElement: true,
   hideClippedValue: true,
}
  1. Date histogram aggregation with very small bar widths:

XY axis
image

Vislib
image

Lens
Lens doesn't allow the users to depict values on histograms
image

The old implementation hides the values if the bar widths are very small. XY axis tries to do it but it seems that it doesn't fit well in all cases

  1. Split series with terms aggregation (small bar height)

XY charts
Screenshot 2021-06-08 at 1 35 25 PM

Vislib
image

Lens
Here also the setting to turn on the values is also disabled

  1. Both x-axis and split series with terms aggregation for non-stacked bars

XY chart
image

Vislib
image

Lens
image

Lens depicts the values vertically in order to fit.

Moreover we had some feedback about the white outline too #97428

@stratoula stratoula added bug Fixes for quality problems that affect the customer experience discuss Feature:XYAxis XY-Axis charts (bar, area, line) Feature:ElasticCharts Issues related to the elastic-charts library Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Jun 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@elasticmachine
Copy link
Contributor

Pinging @elastic/datavis (Feature:ElasticCharts)

@stratoula stratoula changed the title [XY axis] Values on bar chart [XY axis] Values on bar charts Jun 8, 2021
@stratoula
Copy link
Contributor Author

I like the way that vislib handles this.

  • If the value doesn't fit, it is not rendered
  • I think we can go with smaller font size
  • I don't think that rendering the value vertically as Lens does is the best solution here because it is not so readable
  • It would be awesome if we could change the color of the font depending on the bar color. In that way, we could avoid using the white outline

These are some thoughts. I would love your feedback @ghudgins @markov00 @flash1293

@flash1293
Copy link
Contributor

I think your list is great @stratoula - can we configure these things in current elastic-charts? I think we can control the font size but the others can't be configured to behave like the vislib feature at the moment, right?

@stratoula
Copy link
Contributor Author

stratoula commented Jun 8, 2021

Exactly Joe. If I am not mistaken I think we can't configure the others. It would be awesome if we could have the same behavior between Lens and XY axis. In that way, we could remove the logic of disabling the setting for histograms.

@dej611
Copy link
Contributor

dej611 commented Jun 8, 2021

  • If the value doesn't fit, it is not rendered

I agree on this. I think there's a combination of options that leads to the vertical stacking layout, but it would be nice to avoid that. For instance the hide clipped value option could cover also this case.

  • I think we can go with smaller font size

I think it has been discussed already this and we picked a specific min font size in Lens.

  • I don't think that rendering the value vertically as Lens does is the best solution here because it is not so readable

See first point.

  • It would be awesome if we could change the color of the font depending on the bar color. In that way, we could avoid using the white outline

Agree, I also like this solution as well. I've tried in the past to implement this, but there's still some work to do - for instance it's tricky how to compute contrast with the background in this case.

@flash1293
Copy link
Contributor

I think it has been discussed already this and we picked a specific min font size in Lens.

That's true, however there were multiple user complaints about this configuration which I think makes it worth reconsidering.

@ghudgins
Copy link
Contributor

All of these ideas sound great: 1) don't render if it doesn't fit 2) decrease font size for value labels 3) color options or something that alleviates the white outline complaint

related charts issue: elastic/elastic-charts#1123

@timductive timductive added the impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. label Jul 20, 2021
@stratoula stratoula self-assigned this Jul 21, 2021
@stratoula stratoula added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience discuss Feature:ElasticCharts Issues related to the elastic-charts library Feature:Lens Feature:XYAxis XY-Axis charts (bar, area, line) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants