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
API xgrids function doesn't dinamically load the class of the new gridlines #2185
Comments
The problem, looking at the source, is that classes are only applied to new grid lines. However, the grid lines are indexed by number, not by any data property, so the new grid line you add - "Label 2" - ends up reusing and overwriting the "Label 1" text and position. You can tell as it animates across. However it doesn't apply the new class type so it stays the original colour. Quick fix is this:
right after you add your new grid lines See http://jsfiddle.net/hm5znbgt/4/ Long term solution for the c3 maintainers is to change the code in the updateGrid and redrawGrid functions
The above worked for me but hasn't been tested except on the example above. I had to change the redraw grid code as adding the class update as an extra element in the array there seemed to cause some future transition to override the .exit() transition of old lines so they stayed around. The alternative is just to do the class update as a non-transition change in updateGrid because class attribute changes themselves aren't usefully transitionable (is that a word, it is now) anyways Sorry is isn't done as a pull request or nuffink, but I'm no good at github :-) |
Hey, The quickfix you provided works perfectly for me. Thanks a lot. Regards, |
Hi, I've been using this library for a while and it's really good, congrats.
Recently I have found a problem when loading a new set of x grid lines which have different classes.
Please check out this fiddle: http://jsfiddle.net/hm5znbgt/1/
Thanks,
Gabor
The text was updated successfully, but these errors were encountered: