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: barchart disappearance bars issue #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yassinedorbozgithub
Copy link
Collaborator

Motivation

I find that Gamma data is hidden from the bar chart when we click on the legend at the bottom of the chart as mentioned in the screenshot below.
This PR fixes this issue.

Fixes #71

Type of change

Please delete options that are not relevant.

  • 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 not work as expected)
  • This change requires a documentation update

Checklist:

  • I have done the work for both react and vue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (Storybook)
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Contributor

@nour-borgi nour-borgi left a comment

Choose a reason for hiding this comment

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

Tested this, working as expected ! nice job 🚀

One thing, the minimum of the domain axis is set to 0. This is should be discussed with @marrouchi.

Copy link
Contributor

@marrouchi marrouchi left a comment

Choose a reason for hiding this comment

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

Thanks @yassinedorbozgithub , I left you some comment. Please LTMK if it makes sense to you.

Comment on lines 100 to +102
nice: xAxis.nice || 0,
reverse: isRTL,
domain: [0, xAxisDomainMaxValue],
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
nice: xAxis.nice || 0,
reverse: isRTL,
domain: [0, xAxisDomainMaxValue],
nice: typeof xAxis.nice !== 'undefined' ? xAxis.nice : 1,
reverse: isRTL,

Note that values could be negative, so we cannot set zero as lower band. By default the scale will compute the min and max by using the xAxis.domainKey, so there's no need to re-calculate the max value. I think we should set nice to "1" if none is provided to solve the issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey @marrouchi still have the problem after applying the request update
image

@@ -172,6 +174,7 @@ export default class BarChart extends mixins(ToggleDatumMixin) {
domainKey: xAxis.domainKey,
nice: xAxis.nice || 0,
reverse: isRTL,
domain: [0, xAxisDomainMaxValue],
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

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.

🐛 [BUG] eazychart- [React | Vue] - Disappearance of some bars from the Bar Chart
3 participants