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
61313478
Commit
61313478
authored
Aug 03, 2017
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graph: adds decimals option for y-axis
Fixes #8187
parent
ef0c90b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
public/app/plugins/panel/graph/axes_editor.html
+12
-8
public/app/plugins/panel/graph/graph.ts
+2
-0
No files found.
public/app/plugins/panel/graph/axes_editor.html
View file @
61313478
...
...
@@ -4,34 +4,38 @@
<h5
class=
"section-heading"
ng-show=
"$index === 0"
>
Left Y
</h5>
<h5
class=
"section-heading"
ng-show=
"$index === 1"
>
Right Y
</h5>
<gf-form-switch
class=
"gf-form"
label=
"Show"
label-class=
"width-
5
"
checked=
"yaxis.show"
on-change=
"ctrl.render()"
></gf-form-switch>
<gf-form-switch
class=
"gf-form"
label=
"Show"
label-class=
"width-
6
"
checked=
"yaxis.show"
on-change=
"ctrl.render()"
></gf-form-switch>
<div
ng-if=
"yaxis.show"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-
5
"
>
Unit
</label>
<div
class=
"gf-form-dropdown-typeahead max-width-
15
"
ng-model=
"yaxis.format"
dropdown-typeahead2=
"ctrl.unitFormats"
dropdown-typeahead-on-select=
"ctrl.setUnitFormat(yaxis, $subItem)"
></div>
<label
class=
"gf-form-label width-
6
"
>
Unit
</label>
<div
class=
"gf-form-dropdown-typeahead max-width-
20
"
ng-model=
"yaxis.format"
dropdown-typeahead2=
"ctrl.unitFormats"
dropdown-typeahead-on-select=
"ctrl.setUnitFormat(yaxis, $subItem)"
></div>
</div>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-
5
"
>
Scale
</label>
<div
class=
"gf-form-select-wrapper max-width-
15
"
>
<label
class=
"gf-form-label width-
6
"
>
Scale
</label>
<div
class=
"gf-form-select-wrapper max-width-
20
"
>
<select
class=
"gf-form-input"
ng-model=
"yaxis.logBase"
ng-options=
"v as k for (k, v) in ctrl.logScales"
ng-change=
"ctrl.render()"
></select>
</div>
</div>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-
5
"
>
Y-Min
</label>
<label
class=
"gf-form-label width-
6
"
>
Y-Min
</label>
<input
type=
"text"
class=
"gf-form-input width-5"
placeholder=
"auto"
empty-to-null
ng-model=
"yaxis.min"
ng-change=
"ctrl.render()"
ng-model-onblur
>
</div>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-
5
"
>
Y-Max
</label>
<label
class=
"gf-form-label width-
6
"
>
Y-Max
</label>
<input
type=
"text"
class=
"gf-form-input width-5"
placeholder=
"auto"
empty-to-null
ng-model=
"yaxis.max"
ng-change=
"ctrl.render()"
ng-model-onblur
>
</div>
</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
>
</div>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-
5
"
>
Label
</label>
<label
class=
"gf-form-label width-
6
"
>
Label
</label>
<input
type=
"text"
class=
"gf-form-input max-width-20"
ng-model=
"yaxis.label"
ng-change=
"ctrl.render()"
ng-model-onblur
>
</div>
</div>
...
...
public/app/plugins/panel/graph/graph.ts
View file @
61313478
...
...
@@ -498,6 +498,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
logBase
:
panel
.
yaxes
[
0
].
logBase
||
1
,
min
:
panel
.
yaxes
[
0
].
min
?
_
.
toNumber
(
panel
.
yaxes
[
0
].
min
)
:
null
,
max
:
panel
.
yaxes
[
0
].
max
?
_
.
toNumber
(
panel
.
yaxes
[
0
].
max
)
:
null
,
tickDecimals
:
panel
.
yaxes
[
0
].
decimals
!==
null
?
_
.
toNumber
(
panel
.
yaxes
[
0
].
decimals
):
null
};
options
.
yaxes
.
push
(
defaults
);
...
...
@@ -510,6 +511,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
secondY
.
position
=
'right'
;
secondY
.
min
=
panel
.
yaxes
[
1
].
min
?
_
.
toNumber
(
panel
.
yaxes
[
1
].
min
)
:
null
;
secondY
.
max
=
panel
.
yaxes
[
1
].
max
?
_
.
toNumber
(
panel
.
yaxes
[
1
].
max
)
:
null
;
secondY
.
tickDecimals
=
panel
.
yaxes
[
1
].
decimals
!==
null
?
_
.
toNumber
(
panel
.
yaxes
[
1
].
decimals
):
null
;
options
.
yaxes
.
push
(
secondY
);
applyLogScale
(
options
.
yaxes
[
1
],
data
);
...
...
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