You can clone with
Original author: gabriel....@datadeflator.com (September 13, 2012 23:18:33)
Using jquery.flot.js (commit: c202303) from master.
When maxIndex == neededColors at line 441, neededColors isn't correctly adjusted. An indexing error later occurs at colors[s.color], line 485.
Attached test.html: one series with .color = 0; maxIndex = 0 and neededColors = 0. neededColors should be adjusted to 1.
Attached test2.html: two series with .color = numeric index and one series with .color = null; maxIndex = 1 and neededColors = 1. neededColors should be adjusted to 2.
Proposed fix: init maxIndex to -1 (instead of 0) and compare maxIndex >= neededColors (instead of >)
Original issue: http://code.google.com/p/flot/issues/detail?id=753
I'm having this error Uncaught TypeError: Cannot call method 'toString' of undefined jquery.flot.js:485
Using the same replicate of the test examples.
How do I resolve this?
This is first of all a question for the forums, and in any case it doesn't have anything to do with this issue. I'd guess that it's due to your 'color: 0', which isn't a valid color definition. Deleting both of these comments in a couple of days.
Committed fix for #906 partially fixes this bug. However,
jquery.flot.js:424: maxIndex should be initialized to -1 instead of 0.
Scenario: if every series had a css color spec setting (so no numeric color indexes were specified), a single color would still be generated unnecessarily. neededColors would've counted down to 0. maxIndex >= neededColors would pass, setting neededColors to 1.
Prevent color generation with all fixed indexes.
As pointed out in a comment to #832, initializing maxIndex to zero
results in the creation of a single color even when all indexes are
Thanks for pointing that out! It's fixed in master now.