-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Adding negative values on graphics bar #58
base: master
Are you sure you want to change the base?
Conversation
Thanks, @bougetalife, the format seems not right, make sure you run |
src/Bar.js
Outdated
backgroundColor: 'white', | ||
isShorterLabelActive: false, | ||
charNum: 5, | ||
shorterLabels: [], |
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.
Let's focus on Adding negative values on bar chart
for this PR first and not changing the options for bar chart.
Because:
- we need to make sure these options not only valid for bar but also other charts
- For shorter labels, adding 3 more options seems too overwhelming. We can discuss this in another issue or PR
src/Bar.js
Outdated
.attr('height', (d) => this.height - yScale(d)) | ||
// .attr('y', (d) => yScale(d)) | ||
// .attr('height', (d) => this.height - yScale(d)) | ||
.attr('y', (d) => getRectY(this.height,d) ) /////////////////////// |
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.
unnecessary comments should be removed
|
||
function getYScale(height,min,max){ | ||
if (min < 0 && max > 0 ) |
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.
@bikingbadger Sorry for the late reply
I see many formatting issues in this PR.
e.g. here is an unnecessary space
Can you lint the code via npm run lint
, and fix the formatting issues?
New Feature
We can use Bar chart with negative values
Option is added in order to obtain shorter labels on X axis. Label length remains the same on each bar when mouse is over.
Screenshot before and after this change
BEFORE
AFTER