Bar fixes#1142
Merged
Merged
Conversation
* Fixed bug computing the normalisation of bar plots in group mode. * The bug was caused by calling `sieve.put` with bar sizes that didn't take into account the bar base. * Bar plots in stack and relative mode weren't affected by this bug, because traces that set a bar base are excluded from the stack/relative mode.
* Fix hover xLabelVal and yLabelVal so that it takes into account the bar base.
* Updated hover tests in bar_test to test that hover labels honor bar bases.
Contributor
|
Thanks @n-riesco ! |
etpinard
reviewed
Nov 17, 2016
| else { | ||
| pointData.y0 = pointData.y1 = ya.c2p(di.y, true); | ||
| pointData.yLabelVal = di.s; | ||
| pointData.yLabelVal = di.b + di.s; |
Contributor
There was a problem hiding this comment.
@n-riesco this line here is breaking hover for barmode: 'stack' bar charts.
Can share some insights on why you added this?
Contributor
Author
There was a problem hiding this comment.
I'll have a look and see what's broken. Is di.b defined? If I remember correctly it isn't for size-0 bars.
Contributor
There was a problem hiding this comment.
Great. Thanks!
Here's the simplest case http://codepen.io/etpinard/pen/Woopae
Contributor
Author
There was a problem hiding this comment.
So the problem is that now the bar size in non-stacked bars is di.b + di.s, whereas in stacked bars is just di.s. We could distinguish both cases just by checking whether the trace defines base. I'll submit a PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From n-riesco#4 (comment)