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
da1279aa
Commit
da1279aa
authored
Aug 20, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added zindex per series override option, #425
parent
3ec053be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
3 deletions
+22
-3
src/app/components/timeSeries.js
+2
-0
src/app/directives/grafanaGraph.js
+2
-0
src/app/panels/graph/seriesOverridesCtrl.js
+1
-0
src/test/specs/grafanaGraph-specs.js
+11
-1
src/test/specs/timeSeries-specs.js
+6
-2
No files found.
src/app/components/timeSeries.js
View file @
da1279aa
...
...
@@ -9,6 +9,7 @@ function (_, kbn) {
this
.
datapoints
=
opts
.
datapoints
;
this
.
info
=
opts
.
info
;
this
.
label
=
opts
.
info
.
alias
;
this
.
zindex
=
0
;
}
function
matchSeriesOverride
(
aliasOrRegex
,
seriesAlias
)
{
...
...
@@ -45,6 +46,7 @@ function (_, kbn) {
if
(
override
.
linewidth
!==
void
0
)
{
this
.
lines
.
lineWidth
=
override
.
linewidth
;
}
if
(
override
.
pointradius
!==
void
0
)
{
this
.
points
.
radius
=
override
.
pointradius
;
}
if
(
override
.
steppedLine
!==
void
0
)
{
this
.
lines
.
steps
=
override
.
steppedLine
;
}
if
(
override
.
zindex
!==
void
0
)
{
this
.
zindex
=
override
.
zindex
;
}
if
(
override
.
yaxis
!==
void
0
)
{
this
.
info
.
yaxis
=
override
.
yaxis
;
}
...
...
src/app/directives/grafanaGraph.js
View file @
da1279aa
...
...
@@ -168,6 +168,8 @@ function (angular, $, kbn, moment, _) {
addAnnotations
(
options
);
configureAxisOptions
(
data
,
options
);
data
=
_
.
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
))
{
...
...
src/app/panels/graph/seriesOverridesCtrl.js
View file @
da1279aa
...
...
@@ -66,6 +66,7 @@ define([
$scope
.
addOverrideOption
(
'Points Radius'
,
'pointradius'
,
[
1
,
2
,
3
,
4
,
5
]);
$scope
.
addOverrideOption
(
'Stack'
,
'stack'
,
[
true
,
false
]);
$scope
.
addOverrideOption
(
'Y-axis'
,
'yaxis'
,
[
1
,
2
]);
$scope
.
addOverrideOption
(
'Z-index'
,
'zindex'
,
[
-
1
,
-
2
,
-
3
,
0
,
1
,
2
,
3
]);
$scope
.
updateCurrentOverrides
();
});
...
...
src/test/specs/grafanaGraph-specs.js
View file @
da1279aa
...
...
@@ -71,7 +71,6 @@ define([
expect
(
ctx
.
plotOptions
.
series
.
lines
.
lineWidth
).
to
.
be
(
3
);
expect
(
ctx
.
plotOptions
.
series
.
lines
.
steps
).
to
.
be
(
true
);
});
});
graphScenario
(
'series option overrides, fill & points'
,
function
(
ctx
)
{
...
...
@@ -92,6 +91,17 @@ define([
});
});
graphScenario
(
'should order series order according to zindex'
,
function
(
ctx
)
{
ctx
.
setup
(
function
(
scope
,
data
)
{
data
[
0
].
zindex
=
2
;
});
it
(
'should move zindex 2 last'
,
function
()
{
expect
(
ctx
.
plotData
[
0
].
info
.
alias
).
to
.
be
(
'series2'
);
expect
(
ctx
.
plotData
[
1
].
info
.
alias
).
to
.
be
(
'series1'
);
});
});
});
});
src/test/specs/timeSeries-specs.js
View file @
da1279aa
...
...
@@ -93,14 +93,18 @@ define([
});
});
describe
(
'override series y-axis'
,
function
()
{
describe
(
'override series y-axis
, and z-index
'
,
function
()
{
beforeEach
(
function
()
{
series
.
info
.
alias
=
'test'
;
series
.
applySeriesOverrides
([{
alias
:
'test'
,
yaxis
:
2
}]);
series
.
applySeriesOverrides
([{
alias
:
'test'
,
yaxis
:
2
,
zindex
:
2
}]);
});
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