Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
d95545b5
Commit
d95545b5
authored
Aug 10, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(graph tooltip): refactoring PR #3063
parent
34804bda
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
public/app/plugins/panel/graph/graph_tooltip.js
+14
-13
No files found.
public/app/plugins/panel/graph/graph_tooltip.js
View file @
d95545b5
...
...
@@ -41,9 +41,8 @@ function ($, _) {
};
this
.
getMultiSeriesPlotHoverInfo
=
function
(
seriesList
,
pos
)
{
var
value
,
i
,
series
,
hoverIndex
,
hoverDistance
;
var
value
,
i
,
series
,
hoverIndex
,
hoverDistance
,
pointTime
;
var
results
=
[];
var
seriesTimes
=
new
Array
(
seriesList
.
length
);
//now we know the current X (j) position for X and Y values
var
last_value
=
0
;
//needed for stacked values
...
...
@@ -62,13 +61,8 @@ function ($, _) {
}
hoverIndex
=
this
.
findHoverIndexFromData
(
pos
.
x
,
series
);
// Store distance for each highlighted point
hoverDistance
=
Math
.
abs
(
pos
.
x
-
series
.
data
[
hoverIndex
][
0
]);
seriesTimes
[
i
]
=
{
time
:
series
.
data
[
hoverIndex
][
0
],
distance
:
hoverDistance
};
pointTime
=
series
.
data
[
hoverIndex
][
0
];
if
(
series
.
stack
)
{
if
(
panel
.
tooltip
.
value_type
===
'individual'
)
{
...
...
@@ -88,15 +82,22 @@ function ($, _) {
// stacked and steppedLine plots can have series with different length.
// Stacked series can increase its length on each new stacked serie if null points found,
// to speed the index search we begin always on the last found hoverIndex.
var
newhoverIndex
=
this
.
findHoverIndexFromDataPoints
(
pos
.
x
,
series
,
hoverIndex
);
results
.
push
({
value
:
value
,
hoverIndex
:
newhoverIndex
,
color
:
series
.
color
,
label
:
series
.
label
});
}
else
{
results
.
push
({
value
:
value
,
hoverIndex
:
hoverIndex
,
color
:
series
.
color
,
label
:
series
.
label
});
hoverIndex
=
this
.
findHoverIndexFromDataPoints
(
pos
.
x
,
series
,
hoverIndex
);
hoverDistance
=
Math
.
abs
(
pos
.
x
-
series
.
data
[
hoverIndex
][
0
]);
}
results
.
push
({
value
:
value
,
hoverIndex
:
hoverIndex
,
color
:
series
.
color
,
label
:
series
.
label
,
time
:
pointTime
,
distance
:
hoverDistance
});
}
// Find point which closer to pointer
results
.
time
=
_
.
min
(
seriesTime
s
,
'distance'
).
time
;
results
.
time
=
_
.
min
(
result
s
,
'distance'
).
time
;
return
results
;
};
...
...
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