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
5c73ed6e
Commit
5c73ed6e
authored
Feb 27, 2018
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
heatmap: use series names as top or bottom bounds, depends of datasource
parent
f21cebee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
+9
-3
No files found.
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
View file @
5c73ed6e
...
@@ -204,11 +204,17 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
...
@@ -204,11 +204,17 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
let
xBucketSize
,
yBucketSize
,
bucketsData
,
tsBuckets
;
let
xBucketSize
,
yBucketSize
,
bucketsData
,
tsBuckets
;
// Convert histogram to heatmap. Each histogram bucket represented by the series which name is
// Convert histogram to heatmap. Each histogram bucket represented by the series which name is
// a top bucket bound. Further, these values will be used as X axis labels.
// a top
(or bottom, depends of datasource)
bucket bound. Further, these values will be used as X axis labels.
bucketsData
=
histogramToHeatmap
(
this
.
series
);
bucketsData
=
histogramToHeatmap
(
this
.
series
);
tsBuckets
=
_
.
map
(
this
.
series
,
'label'
);
tsBuckets
=
_
.
map
(
this
.
series
,
'label'
);
// Add empty bottom bucket label
tsBuckets
=
[
''
].
concat
(
tsBuckets
);
if
(
this
.
datasource
&&
this
.
datasource
.
type
===
'prometheus'
)
{
// 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.
tsBuckets
.
push
(
''
);
}
// Calculate bucket size based on heatmap data
// Calculate bucket size based on heatmap data
let
xBucketBoundSet
=
_
.
map
(
_
.
keys
(
bucketsData
),
key
=>
Number
(
key
));
let
xBucketBoundSet
=
_
.
map
(
_
.
keys
(
bucketsData
),
key
=>
Number
(
key
));
...
...
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