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
77f6449d
Commit
77f6449d
authored
Mar 01, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added millisecond detection in series
parent
2db62a21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
public/app/core/time_series2.ts
+10
-0
public/app/plugins/panel/graph/graph_tooltip.js
+9
-3
public/app/plugins/panel/graph/module.ts
+3
-0
No files found.
public/app/core/time_series2.ts
View file @
77f6449d
...
...
@@ -168,4 +168,14 @@ export default class TimeSeries {
formatValue
(
value
)
{
return
this
.
valueFormater
(
value
,
this
.
decimals
,
this
.
scaledDecimals
);
}
isMsResolutionNeeded
()
{
for
(
var
j
=
0
;
j
<
this
.
datapoints
.
length
;
j
++
)
{
var
timestamp
=
this
.
datapoints
[
j
][
1
].
toString
();
if
(
timestamp
.
length
===
13
&&
parseInt
(
timestamp
.
substring
(
10
,
13
))
!==
0
)
{
return
true
;
}
}
return
false
;
}
}
public/app/plugins/panel/graph/graph_tooltip.js
View file @
77f6449d
...
...
@@ -109,7 +109,13 @@ function ($) {
var
plot
=
elem
.
data
().
plot
;
var
plotData
=
plot
.
getData
();
var
seriesList
=
getSeriesFn
();
var
group
,
value
,
absoluteTime
,
relativeTime
,
hoverInfo
,
i
,
series
,
seriesHtml
;
var
group
,
value
,
absoluteTime
,
relativeTime
,
hoverInfo
,
i
,
series
,
seriesHtml
,
tooltipFormat
;
if
(
panel
.
tooltip
.
msResolution
)
{
tooltipFormat
=
'YYYY-MM-DD HH:mm:ss.SSS'
;
}
else
{
tooltipFormat
=
'YYYY-MM-DD HH:mm:ss'
;
}
if
(
dashboard
.
sharedCrosshair
)
{
ctrl
.
publishAppEvent
(
'setCrosshair'
,
{
pos
:
pos
,
scope
:
scope
});
...
...
@@ -127,7 +133,7 @@ function ($) {
seriesHtml
=
''
;
relativeTime
=
dashboard
.
getRelativeTime
(
seriesHoverInfo
.
time
);
absoluteTime
=
dashboard
.
formatDate
(
seriesHoverInfo
.
time
);
absoluteTime
=
dashboard
.
formatDate
(
seriesHoverInfo
.
time
,
tooltipFormat
);
for
(
i
=
0
;
i
<
seriesHoverInfo
.
length
;
i
++
)
{
hoverInfo
=
seriesHoverInfo
[
i
];
...
...
@@ -164,7 +170,7 @@ function ($) {
value
=
series
.
formatValue
(
value
);
relativeTime
=
dashboard
.
getRelativeTime
(
item
.
datapoint
[
0
]);
absoluteTime
=
dashboard
.
formatDate
(
item
.
datapoint
[
0
]);
absoluteTime
=
dashboard
.
formatDate
(
item
.
datapoint
[
0
]
,
tooltipFormat
);
group
+=
'<div class="graph-tooltip-value">'
+
value
+
'</div>'
;
...
...
public/app/plugins/panel/graph/module.ts
View file @
77f6449d
...
...
@@ -69,6 +69,7 @@ var panelDefaults = {
tooltip
:
{
value_type
:
'cumulative'
,
shared
:
true
,
msResolution
:
false
,
},
// time overrides
timeFrom
:
null
,
...
...
@@ -200,6 +201,8 @@ class GraphCtrl extends MetricsPanelCtrl {
}
this
.
datapointsCount
+=
datapoints
.
length
;
this
.
panel
.
tooltip
.
msResolution
=
this
.
panel
.
tooltip
.
msResolution
||
series
.
isMsResolutionNeeded
();
}
return
series
;
...
...
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