Skip to content

Conversation

@tannerlinsley
Copy link
Contributor

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

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
sumNeg = 0;

for (var i = this.chart.data.datasets.length - 1; i > datasetIndex; i--) {
for (var i = 0; i < datasetIndex; i++) {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

@etimberg
Copy link
Member

Looks good. Just want to confirm that stackedArea charts aren't broken. Checked the test failures ... they are due to coveralls.io being down.

tannerlinsley added a commit that referenced this pull request Feb 17, 2016
…e-legend

Fix stacking, tooltip, and legend order for stackables
@tannerlinsley tannerlinsley merged commit f572125 into v2.0-dev Feb 17, 2016
@tannerlinsley tannerlinsley deleted the fix-stacking-order-and-reversable-legend branch February 17, 2016 20:11
@dcm4c0
Copy link

dcm4c0 commented Apr 11, 2016

image
The "reverse" option only changes the legends but not the overlapping in the chart, am i missing an option here?

@tannerlinsley
Copy link
Contributor Author

legend: reverse: true doesn't affect the chart stacking, it simply
reverses the legend item order. You would probably need to
datasets.reverse() as there is nothing built in to chartjs to reverse the
order of your dataset items.

On Mon, Apr 11, 2016 at 2:33 AM Max notifications@github.com wrote:

[image: image]
https://cloud.githubusercontent.com/assets/15612612/14419731/1791cda2-ffc8-11e5-8c50-e4d689a9e09a.png
The "reverse" option only changes the legends but not the overlapping in
the chart, am i missing an option here?


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#2027 (comment)

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.

4 participants