Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
61c1cad9
Commit
61c1cad9
authored
Dec 22, 2012
by
David Schnur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify comments describing color generation.
parent
c22f3f75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
jquery.flot.js
jquery.flot.js
+6
-5
No files found.
jquery.flot.js
View file @
61c1cad9
...
@@ -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
// color
s 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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment