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
78d314a9
Unverified
Commit
78d314a9
authored
Mar 23, 2018
by
Daniel Lee
Committed by
GitHub
Mar 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11140 from grafana/11131_right_legend_responsive
added media breakpoint to legend-right
parents
09df38d9
4f38d237
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
16 deletions
+23
-16
public/app/plugins/panel/graph/legend.ts
+7
-2
public/sass/components/_panel_graph.scss
+16
-14
No files found.
public/app/plugins/panel/graph/legend.ts
View file @
78d314a9
...
@@ -15,6 +15,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
...
@@ -15,6 +15,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
var
seriesList
;
var
seriesList
;
var
i
;
var
i
;
var
legendScrollbar
;
var
legendScrollbar
;
const
legendRightDefaultWidth
=
10
;
scope
.
$on
(
'$destroy'
,
function
()
{
scope
.
$on
(
'$destroy'
,
function
()
{
if
(
legendScrollbar
)
{
if
(
legendScrollbar
)
{
...
@@ -111,6 +112,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
...
@@ -111,6 +112,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
}
function
render
()
{
function
render
()
{
let
legendWidth
=
elem
.
width
();
if
(
!
ctrl
.
panel
.
legend
.
show
)
{
if
(
!
ctrl
.
panel
.
legend
.
show
)
{
elem
.
empty
();
elem
.
empty
();
firstRender
=
true
;
firstRender
=
true
;
...
@@ -163,7 +165,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
...
@@ -163,7 +165,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
}
// render first time for getting proper legend height
// render first time for getting proper legend height
if
(
!
panel
.
legend
.
rightSide
)
{
if
(
!
panel
.
legend
.
rightSide
||
(
panel
.
legend
.
rightSide
&&
legendWidth
!==
legendRightDefaultWidth
)
)
{
renderLegendElement
(
tableHeaderElem
);
renderLegendElement
(
tableHeaderElem
);
elem
.
empty
();
elem
.
empty
();
}
}
...
@@ -227,6 +229,8 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
...
@@ -227,6 +229,8 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
}
function
renderLegendElement
(
tableHeaderElem
)
{
function
renderLegendElement
(
tableHeaderElem
)
{
let
legendWidth
=
elem
.
width
();
var
seriesElements
=
renderSeriesLegendElements
();
var
seriesElements
=
renderSeriesLegendElements
();
if
(
panel
.
legend
.
alignAsTable
)
{
if
(
panel
.
legend
.
alignAsTable
)
{
...
@@ -238,7 +242,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
...
@@ -238,7 +242,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
elem
.
append
(
seriesElements
);
elem
.
append
(
seriesElements
);
}
}
if
(
!
panel
.
legend
.
rightSide
)
{
if
(
!
panel
.
legend
.
rightSide
||
(
panel
.
legend
.
rightSide
&&
legendWidth
!==
legendRightDefaultWidth
)
)
{
addScrollbar
();
addScrollbar
();
}
else
{
}
else
{
destroyScrollbar
();
destroyScrollbar
();
...
@@ -263,6 +267,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
...
@@ -263,6 +267,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
function
destroyScrollbar
()
{
function
destroyScrollbar
()
{
if
(
legendScrollbar
)
{
if
(
legendScrollbar
)
{
legendScrollbar
.
destroy
();
legendScrollbar
.
destroy
();
legendScrollbar
=
undefined
;
}
}
}
}
},
},
...
...
public/sass/components/_panel_graph.scss
View file @
78d314a9
...
@@ -4,24 +4,26 @@
...
@@ -4,24 +4,26 @@
height
:
100%
;
height
:
100%
;
&
--legend-right
{
&
--legend-right
{
flex-direction
:
row
;
@include
media-breakpoint-up
(
sm
)
{
flex-direction
:
row
;
.graph-legend
{
.graph-legend
{
flex
:
0
1
10px
;
flex
:
0
1
10px
;
max-height
:
100%
;
max-height
:
100%
;
}
}
.graph-legend-series
{
.graph-legend-series
{
display
:
block
;
display
:
block
;
padding-left
:
0px
;
padding-left
:
0px
;
}
}
.graph-legend-table
{
.graph-legend-table
{
width
:
auto
;
width
:
auto
;
}
}
.graph-legend-table
.graph-legend-series
{
.graph-legend-table
.graph-legend-series
{
display
:
table-row
;
display
:
table-row
;
}
}
}
}
}
}
}
...
...
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