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
4bdc3a58
Commit
4bdc3a58
authored
Oct 12, 2017
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graph: fix y-axis decimalTick check. Fixes #9405
parent
a7068d83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
public/app/plugins/panel/graph/axes_editor.html
+1
-1
public/app/plugins/panel/graph/graph.ts
+13
-5
No files found.
public/app/plugins/panel/graph/axes_editor.html
View file @
4bdc3a58
...
...
@@ -31,7 +31,7 @@
</div>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-6"
>
Decimals
</label>
<input
type=
"number"
class=
"gf-form-input max-width-20"
placeholder=
"auto"
bs-tooltip=
"'Override automatic decimal precision for y-axis'"
data-placement=
"right"
ng-model=
"yaxis.decimals"
ng-change=
"ctrl.render()"
ng-model-onblur
>
<input
type=
"number"
class=
"gf-form-input max-width-20"
placeholder=
"auto"
empty-to-null
bs-tooltip=
"'Override automatic decimal precision for y-axis'"
data-placement=
"right"
ng-model=
"yaxis.decimals"
ng-change=
"ctrl.render()"
ng-model-onblur
>
</div>
<div
class=
"gf-form"
>
...
...
public/app/plugins/panel/graph/graph.ts
View file @
4bdc3a58
...
...
@@ -497,8 +497,8 @@ function graphDirective($rootScope, timeSrv, popoverSrv, contextSrv) {
show
:
panel
.
yaxes
[
0
].
show
,
index
:
1
,
logBase
:
panel
.
yaxes
[
0
].
logBase
||
1
,
min
:
pa
nel
.
yaxes
[
0
].
min
?
_
.
toNumber
(
panel
.
yaxes
[
0
].
min
)
:
null
,
max
:
pa
nel
.
yaxes
[
0
].
max
?
_
.
toNumber
(
panel
.
yaxes
[
0
].
max
)
:
null
,
min
:
pa
rseNumber
(
panel
.
yaxes
[
0
].
min
)
,
max
:
pa
rseNumber
(
panel
.
yaxes
[
0
].
max
)
,
tickDecimals
:
panel
.
yaxes
[
0
].
decimals
};
...
...
@@ -510,9 +510,9 @@ function graphDirective($rootScope, timeSrv, popoverSrv, contextSrv) {
secondY
.
show
=
panel
.
yaxes
[
1
].
show
;
secondY
.
logBase
=
panel
.
yaxes
[
1
].
logBase
||
1
;
secondY
.
position
=
'right'
;
secondY
.
min
=
pa
nel
.
yaxes
[
1
].
min
?
_
.
toNumber
(
panel
.
yaxes
[
1
].
min
)
:
null
;
secondY
.
max
=
pa
nel
.
yaxes
[
1
].
max
?
_
.
toNumber
(
panel
.
yaxes
[
1
].
max
)
:
null
;
secondY
.
tickDecimals
=
panel
.
yaxes
[
1
].
decimals
!==
null
?
_
.
toNumber
(
panel
.
yaxes
[
1
].
decimals
):
null
;
secondY
.
min
=
pa
rseNumber
(
panel
.
yaxes
[
1
].
min
)
;
secondY
.
max
=
pa
rseNumber
(
panel
.
yaxes
[
1
].
max
)
;
secondY
.
tickDecimals
=
panel
.
yaxes
[
1
].
decimals
;
options
.
yaxes
.
push
(
secondY
);
applyLogScale
(
options
.
yaxes
[
1
],
data
);
...
...
@@ -522,6 +522,14 @@ function graphDirective($rootScope, timeSrv, popoverSrv, contextSrv) {
configureAxisMode
(
options
.
yaxes
[
0
],
panel
.
percentage
&&
panel
.
stack
?
"percent"
:
panel
.
yaxes
[
0
].
format
);
}
function
parseNumber
(
value
:
any
)
{
if
(
value
===
null
||
typeof
value
===
'undefined'
)
{
return
null
;
}
return
_
.
toNumber
(
value
);
}
function
applyLogScale
(
axis
,
data
)
{
if
(
axis
.
logBase
===
1
)
{
return
;
...
...
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