-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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 stacking, tooltip, and legend order for stackables #2027
Fix stacking, tooltip, and legend order for stackables #2027
Conversation
Stacked line and bar charts now behave predictably with the first dataset on the bottom stacked upwards.
Legends can now be reversed with the `reversed: true` property.
Tooltips detect the stacked scale property now, reversing when appropriate
@@ -205,7 +205,7 @@ module.exports = function(Chart) { | |||
var sumPos = 0, | |||
sumNeg = 0; | |||
|
|||
for (var i = this.chart.data.datasets.length - 1; i > datasetIndex; i--) { | |||
for (var i = 0; i < datasetIndex; i++) { |
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.
How does this affect stacked area charts?
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.
All of the datasets are now being passed into the core.controller updater function in reversed order (this ensures the datasets are drawn on top of each other instead of behind each other). The change here is just compensating for that reversal by traversing down dataset values, instead of up.
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.
Perfect! You're good to merge then
Looks good. Just want to confirm that stackedArea charts aren't broken. Checked the test failures ... they are due to coveralls.io being down. |
…e-legend Fix stacking, tooltip, and legend order for stackables
On Mon, Apr 11, 2016 at 2:33 AM Max [email protected] wrote:
|
Stacked line and bar charts now behave predictably with the first
dataset on the bottom stacked upwards.
Legends can now be reversed with the
reversed: true
property.Tooltips detect the stacked scale property now, reversing when
appropriate