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
468c9a90
Commit
468c9a90
authored
Aug 20, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for zindex override removal, should restore series order
parent
da1279aa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
15 deletions
+12
-15
src/app/components/timeSeries.js
+1
-1
src/app/directives/grafanaGraph.js
+3
-3
src/app/panels/graph/styleEditor.html
+5
-8
src/test/specs/grafanaGraph-specs.js
+2
-2
src/test/specs/timeSeries-specs.js
+1
-1
No files found.
src/app/components/timeSeries.js
View file @
468c9a90
...
...
@@ -9,7 +9,6 @@ function (_, kbn) {
this
.
datapoints
=
opts
.
datapoints
;
this
.
info
=
opts
.
info
;
this
.
label
=
opts
.
info
.
alias
;
this
.
zindex
=
0
;
}
function
matchSeriesOverride
(
aliasOrRegex
,
seriesAlias
)
{
...
...
@@ -31,6 +30,7 @@ function (_, kbn) {
this
.
points
=
{};
this
.
bars
=
{};
this
.
info
.
yaxis
=
1
;
this
.
zindex
=
0
;
delete
this
.
stack
;
for
(
var
i
=
0
;
i
<
overrides
.
length
;
i
++
)
{
...
...
src/app/directives/grafanaGraph.js
View file @
468c9a90
...
...
@@ -168,19 +168,19 @@ function (angular, $, kbn, moment, _) {
addAnnotations
(
options
);
configureAxisOptions
(
data
,
options
);
data
=
_
.
sortBy
(
data
,
function
(
series
)
{
return
series
.
zindex
;
});
var
sortedSeries
=
_
.
sortBy
(
data
,
function
(
series
)
{
return
series
.
zindex
;
});
// if legend is to the right delay plot draw a few milliseconds
// so the legend width calculation can be done
if
(
shouldDelayDraw
(
panel
))
{
legendSideLastValue
=
panel
.
legend
.
rightSide
;
setTimeout
(
function
()
{
plot
=
$
.
plot
(
elem
,
data
,
options
);
plot
=
$
.
plot
(
elem
,
sortedSeries
,
options
);
addAxisLabels
();
},
50
);
}
else
{
plot
=
$
.
plot
(
elem
,
data
,
options
);
plot
=
$
.
plot
(
elem
,
sortedSeries
,
options
);
addAxisLabels
();
}
}
...
...
src/app/panels/graph/styleEditor.html
View file @
468c9a90
...
...
@@ -66,16 +66,14 @@
<div
class=
"editor-row"
>
<div
class=
"section"
>
<h5>
Series specific overrides
<tip>
Regex match example: /server[0-3]/i
</tip></h5>
<div>
<div
class=
"grafana-target"
ng-repeat=
"override in panel.seriesOverrides"
ng-controller=
"SeriesOverridesCtrl"
>
<div
class=
"grafana-target-inner-wrapper"
>
<div
class=
"grafana-target-inner"
>
<ul
class=
"grafana-target-controls-left"
>
<li>
<a
class=
"grafana-target-segment"
ng-click=
"removeSeriesOverride(override)"
role=
"menuitem"
>
<i
class=
"icon-remove"
></i>
</a>
<li
class=
"grafana-target-segment>"
<
i
class=
"icon-remove"
ng-click=
"removeSeriesOverride(override)"
></i>
</li>
</ul>
...
...
@@ -90,9 +88,7 @@
class=
"input-medium grafana-target-segment-input"
>
</li>
<li
class=
"grafana-target-segment"
ng-repeat=
"option in currentOverrides"
>
<a
class=
"pointer"
ng-click=
"removeOverride(option)"
>
<i
class=
"icon-remove"
></i>
</a>
<i
class=
"pointer icon-remove"
ng-click=
"removeOverride(option)"
></i>
{{option.name}}: {{option.value}}
</li>
<li
class=
"dropdown"
>
...
...
@@ -105,6 +101,7 @@
</div>
</div>
</div>
</div>
<button
class=
"btn btn-success"
style=
"margin-top: 20px"
ng-click=
"addSeriesOverride()"
>
Add series override rule
</button>
</div>
...
...
src/test/specs/grafanaGraph-specs.js
View file @
468c9a90
...
...
@@ -92,8 +92,8 @@ define([
});
graphScenario
(
'should order series order according to zindex'
,
function
(
ctx
)
{
ctx
.
setup
(
function
(
scope
,
data
)
{
data
[
0
].
zindex
=
2
;
ctx
.
setup
(
function
(
scope
)
{
scope
.
panel
.
seriesOverrides
=
[{
alias
:
'series1'
,
zindex
:
2
}]
;
});
it
(
'should move zindex 2 last'
,
function
()
{
...
...
src/test/specs/timeSeries-specs.js
View file @
468c9a90
...
...
@@ -101,8 +101,8 @@ define([
it
(
'should set yaxis'
,
function
()
{
expect
(
series
.
info
.
yaxis
).
to
.
be
(
2
);
});
it
(
'should set zindex'
,
function
()
{
expect
(
series
.
zindex
).
to
.
be
(
2
);
});
...
...
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