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
807bc5eb
Commit
807bc5eb
authored
Oct 16, 2016
by
benrubson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add time back to result array
parent
9792bd7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
public/app/plugins/panel/graph/graph_tooltip.js
+14
-10
No files found.
public/app/plugins/panel/graph/graph_tooltip.js
View file @
807bc5eb
...
@@ -48,6 +48,8 @@ function ($) {
...
@@ -48,6 +48,8 @@ function ($) {
//now we know the current X (j) position for X and Y values
//now we know the current X (j) position for X and Y values
var
last_value
=
0
;
//needed for stacked values
var
last_value
=
0
;
//needed for stacked values
var
minDistance
,
minTime
;
for
(
i
=
0
;
i
<
seriesList
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
seriesList
.
length
;
i
++
)
{
series
=
seriesList
[
i
];
series
=
seriesList
[
i
];
...
@@ -65,6 +67,13 @@ function ($) {
...
@@ -65,6 +67,13 @@ function ($) {
hoverDistance
=
pos
.
x
-
series
.
data
[
hoverIndex
][
0
];
hoverDistance
=
pos
.
x
-
series
.
data
[
hoverIndex
][
0
];
pointTime
=
series
.
data
[
hoverIndex
][
0
];
pointTime
=
series
.
data
[
hoverIndex
][
0
];
if
(
!
minDistance
||
(
hoverDistance
>=
0
&&
(
hoverDistance
<
minDistance
||
minDistance
<
0
))
||
(
hoverDistance
<
0
&&
hoverDistance
>
minDistance
))
{
minDistance
=
hoverDistance
;
minTime
=
pointTime
;
}
if
(
series
.
stack
)
{
if
(
series
.
stack
)
{
if
(
panel
.
tooltip
.
value_type
===
'individual'
)
{
if
(
panel
.
tooltip
.
value_type
===
'individual'
)
{
value
=
series
.
data
[
hoverIndex
][
1
];
value
=
series
.
data
[
hoverIndex
][
1
];
...
@@ -103,6 +112,9 @@ function ($) {
...
@@ -103,6 +112,9 @@ function ($) {
});
});
}
}
// Find point which closer to pointer
results
.
time
=
minTime
;
return
results
;
return
results
;
};
};
...
@@ -147,6 +159,8 @@ function ($) {
...
@@ -147,6 +159,8 @@ function ($) {
seriesHtml
=
''
;
seriesHtml
=
''
;
absoluteTime
=
dashboard
.
formatDate
(
seriesHoverInfo
.
time
,
tooltipFormat
);
// Dynamically reorder the hovercard for the current time point if the
// Dynamically reorder the hovercard for the current time point if the
// option is enabled, sort by yaxis by default.
// option is enabled, sort by yaxis by default.
if
(
panel
.
tooltip
.
sort
===
2
)
{
if
(
panel
.
tooltip
.
sort
===
2
)
{
...
@@ -163,8 +177,6 @@ function ($) {
...
@@ -163,8 +177,6 @@ function ($) {
});
});
}
}
var
distance
,
time
;
for
(
i
=
0
;
i
<
seriesHoverInfo
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
seriesHoverInfo
.
length
;
i
++
)
{
hoverInfo
=
seriesHoverInfo
[
i
];
hoverInfo
=
seriesHoverInfo
[
i
];
...
@@ -172,13 +184,6 @@ function ($) {
...
@@ -172,13 +184,6 @@ function ($) {
continue
;
continue
;
}
}
if
(
!
distance
||
(
hoverInfo
.
distance
>=
0
&&
(
hoverInfo
.
distance
<
distance
||
distance
<
0
))
||
(
hoverInfo
.
distance
<
0
&&
hoverInfo
.
distance
>
distance
))
{
distance
=
hoverInfo
.
distance
;
time
=
hoverInfo
.
time
;
}
var
highlightClass
=
''
;
var
highlightClass
=
''
;
if
(
item
&&
i
===
item
.
seriesIndex
)
{
if
(
item
&&
i
===
item
.
seriesIndex
)
{
highlightClass
=
'graph-tooltip-list-item--highlight'
;
highlightClass
=
'graph-tooltip-list-item--highlight'
;
...
@@ -194,7 +199,6 @@ function ($) {
...
@@ -194,7 +199,6 @@ function ($) {
plot
.
highlight
(
hoverInfo
.
index
,
hoverInfo
.
hoverIndex
);
plot
.
highlight
(
hoverInfo
.
index
,
hoverInfo
.
hoverIndex
);
}
}
absoluteTime
=
dashboard
.
formatDate
(
time
,
tooltipFormat
);
self
.
showTooltip
(
absoluteTime
,
seriesHtml
,
pos
);
self
.
showTooltip
(
absoluteTime
,
seriesHtml
,
pos
);
}
}
// single series tooltip
// single series tooltip
...
...
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