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
91a921e1
Commit
91a921e1
authored
Aug 01, 2017
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
heatmap: add show legend option
parent
e72baca4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
3 deletions
+24
-3
public/app/plugins/panel/heatmap/color_legend.ts
+12
-2
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
+3
-0
public/app/plugins/panel/heatmap/module.html
+1
-1
public/app/plugins/panel/heatmap/partials/display_editor.html
+8
-0
No files found.
public/app/plugins/panel/heatmap/color_legend.ts
View file @
91a921e1
...
...
@@ -46,7 +46,12 @@ module.directive('heatmapLegend', function() {
let
ctrl
=
scope
.
ctrl
;
let
panel
=
scope
.
ctrl
.
panel
;
render
();
ctrl
.
events
.
on
(
'render'
,
function
()
{
render
();
});
function
render
()
{
if
(
!
_
.
isEmpty
(
ctrl
.
data
))
{
let
legendElem
=
$
(
elem
).
find
(
'svg'
);
let
legendWidth
=
Math
.
floor
(
legendElem
.
outerWidth
());
...
...
@@ -66,7 +71,7 @@ module.directive('heatmapLegend', function() {
drawOpacityLegend
(
elem
,
colorOptions
,
rangeFrom
,
rangeTo
,
maxValue
,
minValue
);
}
}
}
);
}
}
};
});
...
...
@@ -241,7 +246,12 @@ function getOpacityScale(options, maxValue, minValue = 0) {
}
function
getSvgElemX
(
elem
)
{
return
elem
.
get
(
0
).
x
.
baseVal
.
value
;
let
svgElem
=
elem
.
get
(
0
);
if
(
svgElem
&&
svgElem
.
x
&&
svgElem
.
x
.
baseVal
)
{
return
elem
.
get
(
0
).
x
.
baseVal
.
value
;
}
else
{
return
0
;
}
}
function
buildLegendTicks
(
rangeFrom
,
rangeTo
,
maxValue
,
minValue
)
{
...
...
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
View file @
91a921e1
...
...
@@ -26,6 +26,9 @@ let panelDefaults = {
exponent
:
0.5
,
colorScheme
:
'interpolateOranges'
,
},
legend
:
{
show
:
false
},
dataFormat
:
'timeseries'
,
xAxis
:
{
show
:
true
,
...
...
public/app/plugins/panel/heatmap/module.html
View file @
91a921e1
...
...
@@ -8,7 +8,7 @@
<div
class=
"heatmap-panel"
ng-dblclick=
"ctrl.zoomOut()"
></div>
</div>
<div
class=
"heatmap-legend-wrapper"
>
<heatmap-legend></heatmap-legend>
<heatmap-legend
ng-if=
"ctrl.panel.legend.show"
></heatmap-legend>
</div>
</div>
<div
class=
"clearfix"
></div>
public/app/plugins/panel/heatmap/partials/display_editor.html
View file @
91a921e1
...
...
@@ -54,6 +54,14 @@
</div>
<div
class=
"section gf-form-group"
>
<h5
class=
"section-heading"
>
Legend
</h5>
<gf-form-switch
class=
"gf-form"
label-class=
"width-8"
label=
"Show legend"
checked=
"ctrl.panel.legend.show"
on-change=
"ctrl.render()"
>
</gf-form-switch>
</div>
<div
class=
"section gf-form-group"
>
<h5
class=
"section-heading"
>
Buckets
</h5>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-8"
>
Space
</label>
...
...
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