Commit 61c1cad9 authored by David Schnur's avatar David Schnur

Clarify comments describing color generation.

parent c22f3f75
...@@ -423,8 +423,8 @@ Licensed under the MIT license. ...@@ -423,8 +423,8 @@ Licensed under the MIT license.
var neededColors = series.length, maxIndex = 0, i; var neededColors = series.length, maxIndex = 0, i;
// Subtract the number of series that already have fixed // Subtract the number of series that already have fixed colors or
// colors from the number we need to generate. // color indexes from the number that we still need to generate.
for (i = 0; i < series.length; ++i) { for (i = 0; i < series.length; ++i) {
var sc = series[i].color; var sc = series[i].color;
...@@ -436,14 +436,15 @@ Licensed under the MIT license. ...@@ -436,14 +436,15 @@ Licensed under the MIT license.
} }
} }
// If any of the user colors are numeric indexes, then we // If any of the series have fixed color indexes, then we need to
// need to generate at least as many as the highest index. // generate at least as many colors as the highest index.
if (maxIndex >= neededColors) { if (maxIndex >= neededColors) {
neededColors = maxIndex + 1; neededColors = maxIndex + 1;
} }
// Generate the needed colors, based on the option colors // Generate all the colors, using first the option colors and then
// variations on those colors once they're exhausted.
var c, colors = [], colorPool = options.colors, var c, colors = [], colorPool = options.colors,
colorPoolSize = colorPool.length, variation = 0; colorPoolSize = colorPool.length, variation = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment