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
44b7a261
Commit
44b7a261
authored
Jan 11, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(graph): fix for table legend and scroll, fixes #7204, fixes #6628
parent
f4e9bd50
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
public/app/plugins/app/testdata/dashboards/graph_last_1h.json
+0
-0
public/app/plugins/app/testdata/plugin.json
+1
-1
public/app/plugins/panel/graph/legend.js
+12
-4
public/sass/components/_panel_graph.scss
+3
-1
No files found.
public/app/plugins/app/testdata/dashboards/graph_last_1h.json
View file @
44b7a261
This diff is collapsed.
Click to expand it.
public/app/plugins/app/testdata/plugin.json
View file @
44b7a261
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"name"
:
"Grafana Project"
,
"name"
:
"Grafana Project"
,
"url"
:
"http://grafana.org"
"url"
:
"http://grafana.org"
},
},
"version"
:
"1.0.1
5
"
,
"version"
:
"1.0.1
6
"
,
"updated"
:
"2016-09-26"
"updated"
:
"2016-09-26"
},
},
...
...
public/app/plugins/panel/graph/legend.js
View file @
44b7a261
...
@@ -124,6 +124,7 @@ function (angular, _, $) {
...
@@ -124,6 +124,7 @@ function (angular, _, $) {
$container
.
toggleClass
(
'graph-legend-table'
,
panel
.
legend
.
alignAsTable
===
true
);
$container
.
toggleClass
(
'graph-legend-table'
,
panel
.
legend
.
alignAsTable
===
true
);
var
tableHeaderElem
;
if
(
panel
.
legend
.
alignAsTable
)
{
if
(
panel
.
legend
.
alignAsTable
)
{
var
header
=
'<tr>'
;
var
header
=
'<tr>'
;
header
+=
'<th colspan="2" style="text-align:left"></th>'
;
header
+=
'<th colspan="2" style="text-align:left"></th>'
;
...
@@ -135,7 +136,7 @@ function (angular, _, $) {
...
@@ -135,7 +136,7 @@ function (angular, _, $) {
header
+=
getTableHeaderHtml
(
'total'
);
header
+=
getTableHeaderHtml
(
'total'
);
}
}
header
+=
'</tr>'
;
header
+=
'</tr>'
;
$container
.
append
(
$
(
header
)
);
tableHeaderElem
=
$
(
header
);
}
}
if
(
panel
.
legend
.
sort
)
{
if
(
panel
.
legend
.
sort
)
{
...
@@ -148,6 +149,8 @@ function (angular, _, $) {
...
@@ -148,6 +149,8 @@ function (angular, _, $) {
}
}
var
seriesShown
=
0
;
var
seriesShown
=
0
;
var
seriesElements
=
[];
for
(
i
=
0
;
i
<
seriesList
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
seriesList
.
length
;
i
++
)
{
var
series
=
seriesList
[
i
];
var
series
=
seriesList
[
i
];
...
@@ -156,6 +159,7 @@ function (angular, _, $) {
...
@@ -156,6 +159,7 @@ function (angular, _, $) {
}
}
var
html
=
'<div class="graph-legend-series'
;
var
html
=
'<div class="graph-legend-series'
;
if
(
series
.
yaxis
===
2
)
{
html
+=
' graph-legend-series--right-y'
;
}
if
(
series
.
yaxis
===
2
)
{
html
+=
' graph-legend-series--right-y'
;
}
if
(
ctrl
.
hiddenSeries
[
series
.
alias
])
{
html
+=
' graph-legend-series-hidden'
;
}
if
(
ctrl
.
hiddenSeries
[
series
.
alias
])
{
html
+=
' graph-legend-series-hidden'
;
}
html
+=
'" data-series-index="'
+
i
+
'">'
;
html
+=
'" data-series-index="'
+
i
+
'">'
;
...
@@ -180,7 +184,7 @@ function (angular, _, $) {
...
@@ -180,7 +184,7 @@ function (angular, _, $) {
}
}
html
+=
'</div>'
;
html
+=
'</div>'
;
$container
.
append
(
$
(
html
));
seriesElements
.
push
(
$
(
html
));
seriesShown
++
;
seriesShown
++
;
}
}
...
@@ -193,9 +197,13 @@ function (angular, _, $) {
...
@@ -193,9 +197,13 @@ function (angular, _, $) {
}
}
var
topPadding
=
6
;
var
topPadding
=
6
;
$container
.
css
(
"max-height"
,
maxHeight
-
topPadding
);
var
tbodyElem
=
$
(
'<tbody></tbody>'
);
tbodyElem
.
css
(
"height"
,
maxHeight
-
topPadding
);
tbodyElem
.
append
(
tableHeaderElem
);
tbodyElem
.
append
(
seriesElements
);
$container
.
append
(
tbodyElem
);
}
else
{
}
else
{
$container
.
css
(
"max-height"
,
""
);
$container
.
append
(
seriesElements
);
}
}
}
}
}
}
...
...
public/sass/components/_panel_graph.scss
View file @
44b7a261
...
@@ -85,9 +85,11 @@
...
@@ -85,9 +85,11 @@
}
}
.graph-legend-table
{
.graph-legend-table
{
tbody
{
display
:
block
;
overflow-y
:
auto
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
overflow-x
:
hidden
;
display
:
table
;
}
.graph-legend-series
{
.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