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

Correctly handle stacked groups when not adjacent #4937

Merged
merged 2 commits into from Nov 14, 2017

Conversation

jcopperfield
Copy link
Contributor

@jcopperfield jcopperfield commented Nov 10, 2017

Fixes #4897 (stacked group is not rendered correctly when stack group is not adjacent).

Split from PR #4911

Problem
Only the dataset index was used for indexing the stack.

pr_issue_4897

 - issue chartjs#4897: Non adjacent stacked group is not rendered correctly
@simonbrunel simonbrunel added this to the Version 2.8 milestone Nov 14, 2017
},

/**
* Returns the stack index for the given dataset based on groups and bar visibility.
* @param {Number=} [datasetIndex] - The dataset index
Copy link
Member

Choose a reason for hiding this comment

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

[nit] what the purpose of = in {Number=}?

Copy link
Contributor

Choose a reason for hiding this comment

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

Indicates that it's optional: http://usejsdoc.org/tags-type.html

Though I don't think we need both the equals and square brackets. That would seem redundant to me. I would think we should just use one or the other. I was more familiar with the = syntax

Copy link
Member

Choose a reason for hiding this comment

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

Didn't take time to look around, thinking it was a typo, thanks @benmccann! I agree, it's redundant, and I think we already adopted the other form {Number} [datasetIndex] - ..., so I would continue with that one.

@simonbrunel simonbrunel changed the title Fix for issue #4897 Correctly handle stacked groups when not adjacent Nov 14, 2017
@simonbrunel simonbrunel merged commit 447ca40 into chartjs:master Nov 14, 2017
@simonbrunel
Copy link
Member

Thanks @jcopperfield

@jcopperfield jcopperfield deleted the PR-20171110-4897 branch November 14, 2017 09:42
yofreke pushed a commit to yofreke/Chart.js that referenced this pull request Dec 30, 2017
Only the dataset index was used for indexing the stack
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Only the dataset index was used for indexing the stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants