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
5e452e44
Commit
5e452e44
authored
Mar 07, 2018
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
heatmap: able to set upper/lower bucket bound manually
parent
18a90667
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
public/app/plugins/panel/heatmap/axes_editor.ts
+7
-0
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
+5
-2
public/app/plugins/panel/heatmap/partials/axes_editor.html
+9
-0
No files found.
public/app/plugins/panel/heatmap/axes_editor.ts
View file @
5e452e44
...
...
@@ -6,6 +6,7 @@ export class AxesEditorCtrl {
unitFormats
:
any
;
logScales
:
any
;
dataFormats
:
any
;
yBucketBoundModes
:
any
;
/** @ngInject */
constructor
(
$scope
,
uiSegmentSrv
)
{
...
...
@@ -26,6 +27,12 @@ export class AxesEditorCtrl {
'Time series'
:
'timeseries'
,
'Time series buckets'
:
'tsbuckets'
,
};
this
.
yBucketBoundModes
=
{
Auto
:
'auto'
,
Upper
:
'upper'
,
Lower
:
'lower'
,
};
}
setUnitFormat
(
subItem
)
{
...
...
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
View file @
5e452e44
...
...
@@ -33,6 +33,7 @@ let panelDefaults = {
show
:
false
,
},
dataFormat
:
'timeseries'
,
yBucketBound
:
'auto'
,
xAxis
:
{
show
:
true
,
},
...
...
@@ -222,11 +223,13 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
bucketsData
=
histogramToHeatmap
(
this
.
series
);
tsBuckets
=
_
.
map
(
this
.
series
,
'label'
);
if
(
panelDatasource
===
'prometheus'
)
{
const
yBucketBound
=
this
.
panel
.
yBucketBound
;
if
((
panelDatasource
===
'prometheus'
&&
yBucketBound
!==
'lower'
)
||
yBucketBound
===
'upper'
)
{
// Prometheus labels are upper inclusive bounds, so add empty bottom bucket label.
tsBuckets
=
[
''
].
concat
(
tsBuckets
);
}
else
{
// Elasticsearch uses labels as bottom bucket bounds, so add empty top bucket label.
// Elasticsearch uses labels as lower bucket bounds, so add empty top bucket label.
// Use this as a default mode as well.
tsBuckets
.
push
(
''
);
}
...
...
public/app/plugins/panel/heatmap/partials/axes_editor.html
View file @
5e452e44
...
...
@@ -31,6 +31,15 @@
bs-tooltip=
"'Override automatic decimal precision for axis.'"
ng-model=
"ctrl.panel.yAxis.decimals"
ng-change=
"ctrl.render()"
ng-model-onblur
>
</div>
<div
class=
"gf-form"
ng-if=
"ctrl.panel.dataFormat == 'tsbuckets'"
>
<label
class=
"gf-form-label width-8"
>
Bucket bound
</label>
<div
class=
"gf-form-select-wrapper max-width-12"
>
<select
class=
"gf-form-input"
ng-model=
"ctrl.panel.yBucketBound"
ng-options=
"v as k for (k, v) in editor.yBucketBoundModes"
ng-change=
"ctrl.render()"
data-placement=
"right"
bs-tooltip=
"'Use series label as an upper or lower bucket bound.'"
>
</select>
</div>
</div>
</div>
<div
class=
"section gf-form-group"
ng-if=
"ctrl.panel.dataFormat == 'timeseries'"
>
...
...
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