Fixed iteration loop instead of enumeration#5
Open
TeckniX wants to merge 2 commits intokopipejst:masterfrom
TeckniX:patch-1
Open
Fixed iteration loop instead of enumeration#5TeckniX wants to merge 2 commits intokopipejst:masterfrom TeckniX:patch-1
TeckniX wants to merge 2 commits intokopipejst:masterfrom
TeckniX:patch-1
Conversation
Although the for..in is usually correct, it's actually an enumeration instead of a true iteration. The problem came about when using prototype and jQuery.noConflict(). Prototype by default adds a few extra methods to the Array, enumerating through the array, shows the array method, which the plugin tries to render as bars. This causes a lot of 'undefined' values to show up. Doing a proper iteration through the jQuery $.each() method makes it work as it should.
When multi-bar graph is used, the width between arrays can change. e.g.: if you have 6 values for 2007, 6 values for 2008, but only 3 values for 2009, the previous code would apply the width of 2009 bars to the 2008 and 2007 bars. This adds the width to the different bars generated and only does positioning for multi.
Owner
|
@TeckniX Changes for "Fixed multi bar graph width for data diff size" breaks stack graphs, but I would merge change for "Fixed iteration loop instead of enumeration" if you send separate pull request for that. thanks ! |
Author
|
I'm honestly not too familiar with how to split the pull requests - I'll see if I can fix the multi bar graph in the meantime |
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.
Although the for..in is usually correct, it's actually an enumeration instead of a true iteration.
The problem came about when using prototype and jQuery.noConflict().
Prototype by default adds a few extra methods to the Array, enumerating through the array, shows the array method, which the plugin tries to render as bars.
This causes a lot of 'undefined' values to show up. Doing a proper iteration through the jQuery $.each() method makes it work as it should.