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
a9c6bdc1
Commit
a9c6bdc1
authored
Nov 09, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panel(graph): stacking can now handle null values, #6287
parent
485980ee
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
public/app/plugins/panel/graph/graph.ts
+18
-8
No files found.
public/app/plugins/panel/graph/graph.ts
View file @
a9c6bdc1
...
...
@@ -183,6 +183,22 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
}
}
function
getMinTimeStepOfSeries
(
data
)
{
var
min
=
100000000000
;
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
!
data
[
i
].
stats
.
timeStep
)
{
continue
;
}
if
(
data
[
i
].
stats
.
timeStep
<
min
)
{
min
=
data
[
i
].
stats
.
timeStep
;
}
}
return
min
;
}
// Function for rendering panel
function
render_panel
()
{
panelWidth
=
elem
.
width
();
...
...
@@ -279,14 +295,8 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
break
;
}
default
:
{
var
width
;
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
data
[
i
].
stats
.
timeStep
&&
(
width
==
null
||
(
data
[
i
].
stats
.
timeStep
/
1.5
)
<
width
))
{
width
=
data
[
i
].
stats
.
timeStep
/
1.5
;
}
}
if
(
width
)
{
options
.
series
.
bars
.
barWidth
=
width
;
if
(
panel
.
bars
)
{
options
.
series
.
bars
.
barWidth
=
getMinTimeStepOfSeries
(
data
)
/
1.5
;
}
addTimeAxis
(
options
);
break
;
...
...
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