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

Fix StackedBar chart tooltip rendering #163

Merged
merged 4 commits into from
Jun 3, 2019

Conversation

davegomez
Copy link
Contributor

The tooltip rendering for the StackedBar chart is broken.

Description

The Tooltip component was wrongly assuming all charts had the .vertical-marker-container DOM Node causing the charts with no vertical mark to return null to the query and not being able to load the tooltip.

This PR introduce the possibility to query the metadata container where no marker is included in the chart and pass that DOM Node instead.

Motivation and Context

The PR solves the problem with broken tooltips. https://github.com/eventbrite/britecharts-react/issues/150

How Has This Been Tested?

Unit tests has being created to test the case mentioned above.

Screenshots:

stackedbar-tooltip

Types of changes

  • Refactor (changes the way we code something without changing its functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Latest master code has been merged into this branch
  • No commented out code (if required, place // TODO above with explanation)
  • No linting issues
  • Build is successful
  • Updated the documentation
  • Added tests to cover changes
  • All new and existing tests passed

The Tooltip component was wrongly assuming all charts had the .vertical-marker-container DOM Node causing the charts with no vertical mark to not being able to load the tooltip.
@@ -117,7 +118,7 @@ export default class Tooltip extends React.Component {
*
* @ignore
*/
data: PropTypes.object,
data: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, thanks!

@Golodhros
Copy link
Collaborator

Awesome work!
Thanks a lot for the debugging and fixing @davegomez!

@miglesiasEB miglesiasEB merged commit 2dd6235 into britecharts:master Jun 3, 2019
@davegomez davegomez deleted the fix-stackedbar-tooltip branch July 18, 2019 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants