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
1f57cf08
Commit
1f57cf08
authored
Nov 25, 2015
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an option to hide zero values
parent
85382dc2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
0 deletions
+18
-0
public/app/core/time_series.ts
+6
-0
public/app/panels/graph/axisEditor.html
+3
-0
public/app/panels/graph/graph.tooltip.js
+5
-0
public/app/panels/graph/legend.js
+4
-0
No files found.
public/app/core/time_series.ts
View file @
1f57cf08
...
...
@@ -28,6 +28,7 @@ class TimeSeries {
stats
:
any
;
legend
:
boolean
;
allIsNull
:
boolean
;
allIsZero
:
boolean
;
decimals
:
number
;
scaledDecimals
:
number
;
...
...
@@ -96,6 +97,7 @@ class TimeSeries {
this
.
stats
.
avg
=
null
;
this
.
stats
.
current
=
null
;
this
.
allIsNull
=
true
;
this
.
allIsZero
=
true
;
var
ignoreNulls
=
fillStyle
===
'connected'
;
var
nullAsZero
=
fillStyle
===
'null as zero'
;
...
...
@@ -130,6 +132,10 @@ class TimeSeries {
}
}
if
(
currentValue
!=
0
)
{
this
.
allIsZero
=
false
;
}
result
.
push
([
currentTime
,
currentValue
]);
}
...
...
public/app/panels/graph/axisEditor.html
View file @
1f57cf08
...
...
@@ -167,6 +167,9 @@
<li
class=
"tight-form-item last"
>
<editor-checkbox
text=
"Hide empty"
model=
"panel.legend.hideEmpty"
change=
"render()"
></editor-checkbox>
</li>
<li
class=
"tight-form-item last"
>
<editor-checkbox
text=
"Hide zero"
model=
"panel.legend.hideZero"
change=
"render()"
></editor-checkbox>
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
...
...
public/app/panels/graph/graph.tooltip.js
View file @
1f57cf08
...
...
@@ -52,6 +52,11 @@ function ($) {
continue
;
}
if
(
!
series
.
data
.
length
||
(
scope
.
panel
.
legend
.
hideZero
&&
series
.
allIsZero
))
{
results
.
push
({
hidden
:
true
});
continue
;
}
hoverIndex
=
this
.
findHoverIndexFromData
(
pos
.
x
,
series
);
results
.
time
=
series
.
data
[
hoverIndex
][
0
];
...
...
public/app/panels/graph/legend.js
View file @
1f57cf08
...
...
@@ -137,6 +137,10 @@ function (angular, _, $) {
if
(
!
series
.
legend
)
{
continue
;
}
// ignore zero series
if
(
panel
.
legend
.
hideZero
&&
series
.
allIsZero
)
{
continue
;
}
var
html
=
'<div class="graph-legend-series'
;
if
(
series
.
yaxis
===
2
)
{
html
+=
' pull-right'
;
}
...
...
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