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
0cba8183
Commit
0cba8183
authored
Oct 06, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graph: legend and digest phase fix
parent
4285c751
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
src/app/components/timeSeries.js
+17
-16
src/app/directives/grafanaGraph.js
+1
-0
No files found.
src/app/components/timeSeries.js
View file @
0cba8183
...
...
@@ -10,6 +10,7 @@ function (_, kbn) {
this
.
info
=
opts
.
info
;
this
.
label
=
opts
.
info
.
alias
;
this
.
valueFormater
=
kbn
.
valueFormats
.
none
;
this
.
stats
=
{};
}
function
matchSeriesOverride
(
aliasOrRegex
,
seriesAlias
)
{
...
...
@@ -61,9 +62,9 @@ function (_, kbn) {
this
.
color
=
this
.
info
.
color
;
this
.
yaxis
=
this
.
info
.
yaxis
;
this
.
info
.
total
=
0
;
this
.
info
.
max
=
-
212312321312
;
this
.
info
.
min
=
212312321312
;
this
.
stats
.
total
=
0
;
this
.
stats
.
max
=
-
212312321312
;
this
.
stats
.
min
=
212312321312
;
var
ignoreNulls
=
fillStyle
===
'connected'
;
var
nullAsZero
=
fillStyle
===
'null as zero'
;
...
...
@@ -82,27 +83,27 @@ function (_, kbn) {
}
if
(
_
.
isNumber
(
currentValue
))
{
this
.
info
.
total
+=
currentValue
;
this
.
stats
.
total
+=
currentValue
;
}
if
(
currentValue
>
this
.
info
.
max
)
{
this
.
info
.
max
=
currentValue
;
if
(
currentValue
>
this
.
stats
.
max
)
{
this
.
stats
.
max
=
currentValue
;
}
if
(
currentValue
<
this
.
info
.
min
)
{
this
.
info
.
min
=
currentValue
;
if
(
currentValue
<
this
.
stats
.
min
)
{
this
.
stats
.
min
=
currentValue
;
}
result
.
push
([
currentTime
*
1000
,
currentValue
]);
}
if
(
result
.
length
>
2
)
{
this
.
info
.
timeStep
=
result
[
1
][
0
]
-
result
[
0
][
0
];
this
.
stats
.
timeStep
=
result
[
1
][
0
]
-
result
[
0
][
0
];
}
if
(
result
.
length
)
{
this
.
info
.
avg
=
(
this
.
info
.
total
/
result
.
length
);
this
.
info
.
current
=
result
[
result
.
length
-
1
][
1
];
this
.
stats
.
avg
=
(
this
.
stats
.
total
/
result
.
length
);
this
.
stats
.
current
=
result
[
result
.
length
-
1
][
1
];
}
return
result
;
...
...
@@ -113,11 +114,11 @@ function (_, kbn) {
this
.
decimals
=
decimals
;
this
.
scaledDecimals
=
scaledDecimals
;
this
.
info
.
avg
=
this
.
formatValue
(
this
.
info
.
avg
);
this
.
info
.
current
=
this
.
formatValue
(
this
.
info
.
current
);
this
.
info
.
min
=
this
.
formatValue
(
this
.
info
.
min
);
this
.
info
.
max
=
this
.
formatValue
(
this
.
info
.
max
);
this
.
info
.
total
=
this
.
formatValue
(
this
.
info
.
total
);
this
.
info
.
avg
=
this
.
formatValue
(
this
.
stats
.
avg
);
this
.
info
.
current
=
this
.
formatValue
(
this
.
stats
.
current
);
this
.
info
.
min
=
this
.
formatValue
(
this
.
stats
.
min
);
this
.
info
.
max
=
this
.
formatValue
(
this
.
stats
.
max
);
this
.
info
.
total
=
this
.
formatValue
(
this
.
stats
.
total
);
};
TimeSeries
.
prototype
.
formatValue
=
function
(
value
)
{
...
...
src/app/directives/grafanaGraph.js
View file @
0cba8183
...
...
@@ -111,6 +111,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
var
axis
=
yaxis
[
series
.
yaxis
-
1
];
var
formater
=
kbn
.
valueFormats
[
scope
.
panel
.
y_formats
[
series
.
yaxis
-
1
]];
series
.
updateLegendValues
(
formater
,
axis
.
tickDecimals
,
axis
.
scaledDecimals
);
if
(
!
scope
.
$$phase
)
{
scope
.
$digest
();
}
}
}
...
...
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