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
35a7109a
Commit
35a7109a
authored
Dec 08, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring: fixing bug when all values are null
parent
4aad4a06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
public/app/core/time_series2.ts
+12
-6
No files found.
public/app/core/time_series2.ts
View file @
35a7109a
...
...
@@ -44,12 +44,18 @@ export function updateLegendValues(data: TimeSeries[], panel) {
}
export
function
getDataMinMax
(
data
:
TimeSeries
[])
{
const
datamin
=
_
.
minBy
(
data
,
(
series
)
=>
{
return
series
.
stats
.
min
;
}).
stats
.
min
;
const
datamax
=
_
.
maxBy
(
data
,
(
series
:
TimeSeries
)
=>
{
return
series
.
stats
.
max
;
}).
stats
.
max
;
let
datamin
=
null
;
let
datamax
=
null
;
for
(
let
series
of
data
)
{
if
(
datamax
===
null
||
datamax
<
series
.
stats
.
max
)
{
datamax
=
series
.
stats
.
max
;
}
if
(
datamin
===
null
||
datamin
>
series
.
stats
.
min
)
{
datamin
=
series
.
stats
.
min
;
}
}
return
{
datamin
,
datamax
};
}
...
...
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