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
cc145227
Commit
cc145227
authored
Oct 04, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added testdata scenario for null data and stacking, also updated testdata dashbord, #2912
parent
bf4c3f3a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
pkg/tsdb/testdata/scenarios.go
+8
-3
public/app/plugins/app/testdata/dashboards/graph_last_1h.json
+0
-0
public/app/plugins/app/testdata/plugin.json
+1
-1
public/app/plugins/panel/graph/tab_display.html
+2
-6
No files found.
pkg/tsdb/testdata/scenarios.go
View file @
cc145227
...
@@ -6,6 +6,8 @@ import (
...
@@ -6,6 +6,8 @@ import (
"strings"
"strings"
"time"
"time"
"gopkg.in/guregu/null.v3"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/tsdb"
"github.com/grafana/grafana/pkg/tsdb"
)
)
...
@@ -88,10 +90,13 @@ func init() {
...
@@ -88,10 +90,13 @@ func init() {
queryRes
:=
tsdb
.
NewQueryResult
()
queryRes
:=
tsdb
.
NewQueryResult
()
stringInput
:=
query
.
Model
.
Get
(
"stringInput"
)
.
MustString
()
stringInput
:=
query
.
Model
.
Get
(
"stringInput"
)
.
MustString
()
values
:=
[]
float64
{}
values
:=
[]
null
.
Float
{}
for
_
,
strVal
:=
range
strings
.
Split
(
stringInput
,
","
)
{
for
_
,
strVal
:=
range
strings
.
Split
(
stringInput
,
","
)
{
if
strVal
==
"null"
{
values
=
append
(
values
,
null
.
FloatFromPtr
(
nil
))
}
if
val
,
err
:=
strconv
.
ParseFloat
(
strVal
,
64
);
err
==
nil
{
if
val
,
err
:=
strconv
.
ParseFloat
(
strVal
,
64
);
err
==
nil
{
values
=
append
(
values
,
val
)
values
=
append
(
values
,
null
.
FloatFrom
(
val
)
)
}
}
}
}
...
@@ -105,7 +110,7 @@ func init() {
...
@@ -105,7 +110,7 @@ func init() {
step
:=
(
endTime
-
startTime
)
/
int64
(
len
(
values
)
-
1
)
step
:=
(
endTime
-
startTime
)
/
int64
(
len
(
values
)
-
1
)
for
_
,
val
:=
range
values
{
for
_
,
val
:=
range
values
{
series
.
Points
=
append
(
series
.
Points
,
tsdb
.
NewTimePoint
(
val
,
float64
(
startTime
))
)
series
.
Points
=
append
(
series
.
Points
,
tsdb
.
TimePoint
{
val
,
null
.
FloatFrom
(
float64
(
startTime
))}
)
startTime
+=
step
startTime
+=
step
}
}
...
...
public/app/plugins/app/testdata/dashboards/graph_last_1h.json
View file @
cc145227
This diff is collapsed.
Click to expand it.
public/app/plugins/app/testdata/plugin.json
View file @
cc145227
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"name"
:
"Grafana Project"
,
"name"
:
"Grafana Project"
,
"url"
:
"http://grafana.org"
"url"
:
"http://grafana.org"
},
},
"version"
:
"1.0.1
3
"
,
"version"
:
"1.0.1
4
"
,
"updated"
:
"2016-09-26"
"updated"
:
"2016-09-26"
},
},
...
...
public/app/plugins/panel/graph/tab_display.html
View file @
cc145227
...
@@ -71,13 +71,9 @@
...
@@ -71,13 +71,9 @@
<div
class=
"section gf-form-group"
>
<div
class=
"section gf-form-group"
>
<h5
class=
"section-heading"
>
Stacking
&
Null value
</h5>
<h5
class=
"section-heading"
>
Stacking
&
Null value
</h5>
<gf-form-switch
class=
"gf-form"
<gf-form-switch
class=
"gf-form"
label=
"Stack"
label-class=
"width-7"
checked=
"ctrl.panel.stack"
on-change=
"ctrl.render()"
>
label=
"Stack"
label-class=
"width-7"
checked=
"ctrl.panel.stack"
on-change=
"ctrl.render()"
>
</gf-form-switch>
</gf-form-switch>
<gf-form-switch
class=
"gf-form"
ng-show=
"ctrl.panel.stack"
<gf-form-switch
class=
"gf-form"
ng-show=
"ctrl.panel.stack"
label=
"Percent"
label-class=
"width-7"
checked=
"ctrl.panel.percentage"
on-change=
"ctrl.render()"
>
label=
"Percent"
label-class=
"width-7"
checked=
"ctrl.panel.percentage"
on-change=
"ctrl.render()"
>
</gf-form-switch>
</gf-form-switch>
<div
class=
"gf-form"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-7"
>
Null value
</label>
<label
class=
"gf-form-label width-7"
>
Null value
</label>
...
...
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