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
cd21fa70
Commit
cd21fa70
authored
Nov 07, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graph: new legend table display style, #1030
parent
7ba4f6b9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
src/app/panels/graph/axisEditor.html
+1
-0
src/app/panels/graph/legend.js
+14
-0
src/css/less/graph.less
+46
-0
No files found.
src/app/panels/graph/axisEditor.html
View file @
cd21fa70
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
<editor-opt-bool
text=
"Show legend"
model=
"panel.legend.show"
change=
"get_data();"
></editor-opt-bool>
<editor-opt-bool
text=
"Show legend"
model=
"panel.legend.show"
change=
"get_data();"
></editor-opt-bool>
<editor-opt-bool
text=
"Include values"
model=
"panel.legend.values"
change=
"render()"
></editor-opt-bool>
<editor-opt-bool
text=
"Include values"
model=
"panel.legend.values"
change=
"render()"
></editor-opt-bool>
<editor-opt-bool
text=
"Align as table"
model=
"panel.legend.alignAsTable"
change=
"render()"
></editor-opt-bool>
<editor-opt-bool
text=
"Align as table"
model=
"panel.legend.alignAsTable"
change=
"render()"
></editor-opt-bool>
<editor-opt-bool
text=
"Big table mode"
model=
"panel.legend.bigTableMode"
change=
"render()"
></editor-opt-bool>
<editor-opt-bool
text=
"Right side"
model=
"panel.legend.rightSide"
change=
"render()"
></editor-opt-bool>
<editor-opt-bool
text=
"Right side"
model=
"panel.legend.rightSide"
change=
"render()"
></editor-opt-bool>
</div>
</div>
...
...
src/app/panels/graph/legend.js
View file @
cd21fa70
...
@@ -65,6 +65,20 @@ function (angular, app, _, kbn, $) {
...
@@ -65,6 +65,20 @@ function (angular, app, _, kbn, $) {
$container
.
toggleClass
(
'graph-legend-table'
,
panel
.
legend
.
alignAsTable
);
$container
.
toggleClass
(
'graph-legend-table'
,
panel
.
legend
.
alignAsTable
);
if
(
panel
.
legend
.
bigTableMode
)
{
$container
.
toggleClass
(
'graph-legend-big-table'
,
true
);
var
header
=
'<tr>'
;
header
+=
'<th></th>'
;
header
+=
'<th></th>'
;
header
+=
'<th>min</th>'
;
header
+=
'<th>max</th>'
;
header
+=
'<th>avg</th>'
;
header
+=
'<th>current</th>'
;
header
+=
'<th>total</th>'
;
header
+=
'</tr>'
;
$container
.
append
(
$
(
header
));
}
for
(
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
series
=
data
[
i
];
var
series
=
data
[
i
];
var
html
=
'<div class="graph-legend-series'
;
var
html
=
'<div class="graph-legend-series'
;
...
...
src/css/less/graph.less
View file @
cd21fa70
...
@@ -85,6 +85,52 @@
...
@@ -85,6 +85,52 @@
}
}
}
}
.graph-legend-big-table {
width: 100%;
margin: 0;
td, .graph-legend-alias, .graph-legend-icon, .graph-legend-value {
padding: 2px 10px;
white-space: nowrap;
text-align: right;
border-bottom: 1px solid @grafanaListBorderBottom;
&:first-child {
text-align: left;
}
&:last-child td {
border: none;
}
}
.graph-legend-icon {
width: 5px;
padding-right: 0;
}
.graph-legend-alias {
text-align: left;
width: 95%;
}
th {
text-align: right;
padding: 5px 10px;
font-weight: bold;
color: @blue
}
.graph-legend-series:nth-child(odd) {
background-color: @grafanaListAccent;
}
.graph-legend-value {
&.current, &.max, &.min, &.total, &.avg {
&:before {
content: '';
}
}
}
}
.graph-legend-rightside {
.graph-legend-rightside {
...
...
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