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
90632172
Commit
90632172
authored
Jul 16, 2012
by
David Schnur
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38 from eriwen/master
Allow custom highlight color
parents
cc974bd0
46e1221f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
jquery.flot.js
jquery.flot.js
+12
-5
No files found.
jquery.flot.js
View file @
90632172
...
...
@@ -115,7 +115,8 @@
align
:
"left"
,
// "left", "right", or "center"
horizontal
:
false
},
shadowSize
:
3
shadowSize
:
3
,
highlightColor
:
null
},
grid
:
{
show
:
true
,
...
...
@@ -290,6 +291,8 @@
$
.
extend
(
true
,
options
.
series
.
bars
,
options
.
bars
);
if
(
options
.
shadowSize
!=
null
)
options
.
series
.
shadowSize
=
options
.
shadowSize
;
if
(
options
.
highlightColor
!=
null
)
options
.
series
.
highlightColor
=
options
.
highlightColor
;
// save options on axes for future reference
for
(
i
=
0
;
i
<
options
.
xaxes
.
length
;
++
i
)
...
...
@@ -2441,13 +2444,14 @@
function
drawPointHighlight
(
series
,
point
)
{
var
x
=
point
[
0
],
y
=
point
[
1
],
axisx
=
series
.
xaxis
,
axisy
=
series
.
yaxis
;
highlightColor
=
(
typeof
series
.
highlightColor
===
"string"
)
?
series
.
highlightColor
:
$
.
color
.
parse
(
series
.
color
).
scale
(
'a'
,
0.5
).
toString
();
if
(
x
<
axisx
.
min
||
x
>
axisx
.
max
||
y
<
axisy
.
min
||
y
>
axisy
.
max
)
return
;
var
pointRadius
=
series
.
points
.
radius
+
series
.
points
.
lineWidth
/
2
;
octx
.
lineWidth
=
pointRadius
;
octx
.
strokeStyle
=
$
.
color
.
parse
(
series
.
color
).
scale
(
'a'
,
0.5
).
toString
()
;
octx
.
strokeStyle
=
highlightColor
;
var
radius
=
1.5
*
pointRadius
,
x
=
axisx
.
p2c
(
x
),
y
=
axisy
.
p2c
(
y
);
...
...
@@ -2462,10 +2466,13 @@
}
function
drawBarHighlight
(
series
,
point
)
{
var
highlightColor
=
(
typeof
series
.
highlightColor
===
"string"
)
?
series
.
highlightColor
:
$
.
color
.
parse
(
series
.
color
).
scale
(
'a'
,
0.5
).
toString
(),
fillStyle
=
highlightColor
,
barLeft
=
series
.
bars
.
align
==
"left"
?
0
:
-
series
.
bars
.
barWidth
/
2
;
octx
.
lineWidth
=
series
.
bars
.
lineWidth
;
octx
.
strokeStyle
=
$
.
color
.
parse
(
series
.
color
).
scale
(
'a'
,
0.5
).
toString
();
var
fillStyle
=
$
.
color
.
parse
(
series
.
color
).
scale
(
'a'
,
0.5
).
toString
();
var
barLeft
=
series
.
bars
.
align
==
"left"
?
0
:
-
series
.
bars
.
barWidth
/
2
;
octx
.
strokeStyle
=
highlightColor
;
drawBar
(
point
[
0
],
point
[
1
],
point
[
2
]
||
0
,
barLeft
,
barLeft
+
series
.
bars
.
barWidth
,
0
,
function
()
{
return
fillStyle
;
},
series
.
xaxis
,
series
.
yaxis
,
octx
,
series
.
bars
.
horizontal
,
series
.
bars
.
lineWidth
);
}
...
...
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