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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
public/app/plugins/panel/graph/legend.ts
+7
-2
public/sass/components/_panel_graph.scss
+2
-0
No files found.
public/app/plugins/panel/graph/legend.ts
View file @
78d314a9
...
...
@@ -15,6 +15,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
var
seriesList
;
var
i
;
var
legendScrollbar
;
const
legendRightDefaultWidth
=
10
;
scope
.
$on
(
'$destroy'
,
function
()
{
if
(
legendScrollbar
)
{
...
...
@@ -111,6 +112,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
function
render
()
{
let
legendWidth
=
elem
.
width
();
if
(
!
ctrl
.
panel
.
legend
.
show
)
{
elem
.
empty
();
firstRender
=
true
;
...
...
@@ -163,7 +165,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
// render first time for getting proper legend height
if
(
!
panel
.
legend
.
rightSide
)
{
if
(
!
panel
.
legend
.
rightSide
||
(
panel
.
legend
.
rightSide
&&
legendWidth
!==
legendRightDefaultWidth
)
)
{
renderLegendElement
(
tableHeaderElem
);
elem
.
empty
();
}
...
...
@@ -227,6 +229,8 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
}
function
renderLegendElement
(
tableHeaderElem
)
{
let
legendWidth
=
elem
.
width
();
var
seriesElements
=
renderSeriesLegendElements
();
if
(
panel
.
legend
.
alignAsTable
)
{
...
...
@@ -238,7 +242,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
elem
.
append
(
seriesElements
);
}
if
(
!
panel
.
legend
.
rightSide
)
{
if
(
!
panel
.
legend
.
rightSide
||
(
panel
.
legend
.
rightSide
&&
legendWidth
!==
legendRightDefaultWidth
)
)
{
addScrollbar
();
}
else
{
destroyScrollbar
();
...
...
@@ -263,6 +267,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
function
destroyScrollbar
()
{
if
(
legendScrollbar
)
{
legendScrollbar
.
destroy
();
legendScrollbar
=
undefined
;
}
}
},
...
...
public/sass/components/_panel_graph.scss
View file @
78d314a9
...
...
@@ -4,6 +4,7 @@
height
:
100%
;
&
--legend-right
{
@include
media-breakpoint-up
(
sm
)
{
flex-direction
:
row
;
.graph-legend
{
...
...
@@ -24,6 +25,7 @@
display
:
table-row
;
}
}
}
}
.graph-panel__chart
{
...
...
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