-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Improve bar value styles on vis_type_xy charts #87991
Conversation
fontSize: { min: VALUE_LABELS_MIN_FONTSIZE, max: VALUE_LABELS_MAX_FONTSIZE }, | ||
fill: { textInverted: true, textBorder: 2 }, | ||
alignment: isHorizontal | ||
? { | ||
vertical: VerticalAlignment.Middle, | ||
} | ||
: { horizontal: HorizontalAlignment.Center }, | ||
offsetX: isHorizontal ? VALUE_LABELS_HORIZONTAL_OFFSET : 0, | ||
offsetY: isHorizontal ? 0 : VALUE_LABELS_VERTICAL_OFFSET, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values should all come from the theme
object. This will override all of these properties and ignore the value defined in the theme
.
You should be able to add these overrides via the Settings.theme
prop already. What is the use case for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understood we should use defaults from Lens for values styles. These values which I found in Lens we should use in plugin. As we already have 'themeOverrides' variable I think we should add these defaults there. For convenience I created a separate function for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, sorry 😐. When I looked at this PR I thought this was done in @elastic/charts. Just ignore me and my comment this is perfect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in case of updating description
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
@VladLasitsa can you also add a screenshot on the description, please? 🙏 |
@ryankeairns what do you think? We use the same configuration as Lens but just to be in sync here 🙂 My only concern is that it is not so responsive, especially if you have more than one y axis. |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
@stratoula apologies for the delay in replying. It looks like Lens ran into similar concerns and opted to wait until there is better support from Elastic Charts. #81776 (comment) Should the same approach be taken here? Things do seem to get unwieldy fast. |
I agree we need to handle the edge cases better in elastic charts. I think this is a good start for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM. It works well in most cases. Thanx @ryankeairns and @nickofthyme for your feedback. I agree Nick, it is a good start 🙂
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Closes #82853
Added the same defaults for bar value styles from Lens to vis_type_xy charts.
How it looks with these defaults you can see here:
For maintainers