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

Elastic-charts on non-white backgrounds #249

Closed
3 tasks done
flash1293 opened this issue Jun 25, 2019 · 7 comments · Fixed by #267
Closed
3 tasks done

Elastic-charts on non-white backgrounds #249

flash1293 opened this issue Jun 25, 2019 · 7 comments · Fixed by #267
Labels
enhancement New feature or request released Issue released publicly :styling Styling related issue

Comments

@flash1293
Copy link

flash1293 commented Jun 25, 2019

Is your feature request related to a problem? Please describe.
Currently elastic-charts renders under the assumption of having a full white (#fff) background. If this isn't the case, there are some minor UI issues:
Screenshot 2019-06-25 at 17 14 32

Describe the solution you'd like

  • No fading background on legend container (or having this behavior configurable)
  • Small margin on .echContainer (This could also be done on the consumer side, but it's probably a nice default)

Describe alternatives you've considered
Having a full white background, which works in this specific case, but it would be nice to even out these cases.

Checklist

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present
@flash1293 flash1293 added the enhancement New feature or request label Jun 25, 2019
@markov00 markov00 added the :styling Styling related issue label Jun 26, 2019
@markov00
Copy link
Member

Good catch. I've seen this behaviour and we will for sure fix that.
Let's cc @cchaos because I want to find a nice solution for the gradient: do you think it's possible to change the gradient of the container to reflect the background color?
For the margin, we can do few things:

  • add a padding settings on the component or on the theme (it can create some confusion together with the chartMargins chartPaddings property of the theme)
  • we can compute the parent size minus the .echContainer padding value if someone added a class with that style
  • we can keep it like that and inform the user to specify the padding on the parent
  • any other ideas?

@cchaos
Copy link
Contributor

cchaos commented Jul 2, 2019

The overflow gradient is created via a SASS mixin and can take any color to replace the white. However, @flash1293 I'm guessing that your screenshot is more of a "temporary" background color for the chart? Meaning, that looks like the droppable area background highlight when dragging an item. I don't know what the best approach should be for a highlighted background versus a theme selected background color.

As for the padding around the chart, this should be left to the consumer. Either by supplying them with a top level prop on <Chart> or by informing them to supply their own wrapper to <Chart> with the padding they need.

@flash1293
Copy link
Author

You are right @cchaos, this is about dynamic background colors.
I haven’t tried it but could we use the mask-image property for the overflow effect instead? https://developer.mozilla.org/en-US/docs/Web/CSS/mask-image
Then it would be background independent. I can look into whether this would be possible in our case if you haven’t tried already.

I agree with your comment regarding padding.

@cchaos
Copy link
Contributor

cchaos commented Jul 3, 2019

@flash1293 Good idea with the mask-image. I've created a PR in EUI to fix those.elastic/eui#2088

@flash1293
Copy link
Author

@markov00 The fix will be released with eui 12.3.0 elastic/eui#2088 Can we close this issue?

@markov00
Copy link
Member

@flash1293 I've created a PR to fix that issue, it's on review

markov00 added a commit that referenced this issue Jul 30, 2019
EUI and storybook v5 are updated to their latest versions. The commit also fix the an issue with coloured background and the legend.

fix #249
markov00 pushed a commit that referenced this issue Jul 30, 2019
## [8.1.3](v8.1.2...v8.1.3) (2019-07-30)

### Bug Fixes

* update EUI, storybook and add autoprefixer ([#267](#267)) ([f70e084](f70e084)), closes [#249](#249)
@markov00
Copy link
Member

🎉 This issue has been resolved in version 8.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jul 30, 2019
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released Issue released publicly :styling Styling related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants