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
ad5f1c95
Unverified
Commit
ad5f1c95
authored
Jul 23, 2020
by
Ryan McKinley
Committed by
GitHub
Jul 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graph: support setting field units (#26529)
parent
43ef052d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
public/app/plugins/panel/graph/axes_editor.html
+4
-1
public/app/plugins/panel/graph/module.ts
+2
-0
No files found.
public/app/plugins/panel/graph/axes_editor.html
View file @
ad5f1c95
...
...
@@ -13,7 +13,10 @@
<div
ng-if=
"yaxis.show"
>
<div
class=
"gf-form gf-form--grow"
>
<label
class=
"gf-form-label width-6"
>
Unit
</label>
<label
class=
"gf-form-label width-6"
>
Unit
<info-popover
mode=
"right-normal"
>
The default unit used when not defined by the datasource or in the Fields or Overrides configuration.
</info-popover>
</label>
<unit-picker
onChange=
"ctrl.setUnitFormat(yaxis)"
value=
"yaxis.format"
class=
"flex-grow-1"
/>
</div>
</div>
...
...
public/app/plugins/panel/graph/module.ts
View file @
ad5f1c95
...
...
@@ -305,6 +305,7 @@ export class GraphCtrl extends MetricsPanelCtrl {
for
(
const
series
of
this
.
seriesList
)
{
series
.
applySeriesOverrides
(
this
.
panel
.
seriesOverrides
);
// Always use the configured field unit
if
(
series
.
unit
)
{
this
.
panel
.
yaxes
[
series
.
yaxis
-
1
].
format
=
series
.
unit
;
}
...
...
@@ -378,6 +379,7 @@ export const plugin = new PanelPlugin<GraphPanelOptions, GraphFieldConfig>(null)
.
useFieldConfig
({
standardOptions
:
[
FieldConfigProperty
.
DisplayName
,
FieldConfigProperty
.
Unit
,
FieldConfigProperty
.
Links
,
// previously saved as dataLinks on options
],
})
...
...
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