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