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
af8fec94
Commit
af8fec94
authored
Sep 23, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graph: Fix for series draw order not being the same after hiding/unhiding series, Fixes #847
parent
7fe76d32
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
20 deletions
+24
-20
CHANGELOG.md
+5
-0
src/app/directives/grafanaGraph.js
+6
-20
src/test/specs/grafanaGraph-specs.js
+13
-0
No files found.
CHANGELOG.md
View file @
af8fec94
# 1.9.0 (unreleased)
**Fixes**
-
[
Issue #847
](
https://github.com/grafana/grafana/issues/847
)
. Graph: Fix for series draw order not being the same after hiding/unhiding series
# 1.8.0 (2014-09-22)
# 1.8.0 (2014-09-22)
Read this
[
blog post
](
http://grafana.org/blog/2014/09/11/grafana-1-8-0-rc1-released.html
)
for an overview of all improvements.
Read this
[
blog post
](
http://grafana.org/blog/2014/09/11/grafana-1-8-0-rc1-released.html
)
for an overview of all improvements.
...
...
src/app/directives/grafanaGraph.js
View file @
af8fec94
...
@@ -16,7 +16,6 @@ function (angular, $, kbn, moment, _) {
...
@@ -16,7 +16,6 @@ function (angular, $, kbn, moment, _) {
template
:
'<div> </div>'
,
template
:
'<div> </div>'
,
link
:
function
(
scope
,
elem
)
{
link
:
function
(
scope
,
elem
)
{
var
data
,
annotations
;
var
data
,
annotations
;
var
hiddenData
=
{};
var
dashboard
=
scope
.
dashboard
;
var
dashboard
=
scope
.
dashboard
;
var
legendSideLastValue
=
null
;
var
legendSideLastValue
=
null
;
...
@@ -24,14 +23,7 @@ function (angular, $, kbn, moment, _) {
...
@@ -24,14 +23,7 @@ function (angular, $, kbn, moment, _) {
scope
.
get_data
();
scope
.
get_data
();
});
});
scope
.
$on
(
'toggleLegend'
,
function
(
e
,
series
)
{
scope
.
$on
(
'toggleLegend'
,
function
()
{
_
.
each
(
series
,
function
(
serie
)
{
if
(
hiddenData
[
serie
.
alias
])
{
data
.
push
(
hiddenData
[
serie
.
alias
]);
delete
hiddenData
[
serie
.
alias
];
}
});
render_panel
();
render_panel
();
});
});
...
@@ -95,17 +87,6 @@ function (angular, $, kbn, moment, _) {
...
@@ -95,17 +87,6 @@ function (angular, $, kbn, moment, _) {
}
}
var
panel
=
scope
.
panel
;
var
panel
=
scope
.
panel
;
_
.
each
(
_
.
keys
(
scope
.
hiddenSeries
),
function
(
seriesAlias
)
{
var
dataSeries
=
_
.
find
(
data
,
function
(
series
)
{
return
series
.
info
.
alias
===
seriesAlias
;
});
if
(
dataSeries
)
{
hiddenData
[
dataSeries
.
info
.
alias
]
=
dataSeries
;
data
=
_
.
without
(
data
,
dataSeries
);
}
});
var
stack
=
panel
.
stack
?
true
:
null
;
var
stack
=
panel
.
stack
?
true
:
null
;
// Populate element
// Populate element
...
@@ -156,6 +137,11 @@ function (angular, $, kbn, moment, _) {
...
@@ -156,6 +137,11 @@ function (angular, $, kbn, moment, _) {
var
series
=
data
[
i
];
var
series
=
data
[
i
];
series
.
applySeriesOverrides
(
panel
.
seriesOverrides
);
series
.
applySeriesOverrides
(
panel
.
seriesOverrides
);
series
.
data
=
series
.
getFlotPairs
(
panel
.
nullPointMode
,
panel
.
y_formats
);
series
.
data
=
series
.
getFlotPairs
(
panel
.
nullPointMode
,
panel
.
y_formats
);
// if hidden remove points and disable stack
if
(
scope
.
hiddenSeries
[
series
.
info
.
alias
])
{
series
.
data
=
[];
series
.
stack
=
false
;
}
}
}
if
(
data
.
length
&&
data
[
0
].
info
.
timeStep
)
{
if
(
data
.
length
&&
data
[
0
].
info
.
timeStep
)
{
...
...
src/test/specs/grafanaGraph-specs.js
View file @
af8fec94
...
@@ -29,6 +29,7 @@ define([
...
@@ -29,6 +29,7 @@ define([
y_formats
:
[],
y_formats
:
[],
seriesOverrides
:
[]
seriesOverrides
:
[]
};
};
scope
.
hiddenSeries
=
{};
scope
.
dashboard
=
{
timezone
:
'browser'
};
scope
.
dashboard
=
{
timezone
:
'browser'
};
scope
.
range
=
{
scope
.
range
=
{
from
:
new
Date
(
'2014-08-09 10:00:00'
),
from
:
new
Date
(
'2014-08-09 10:00:00'
),
...
@@ -145,6 +146,18 @@ define([
...
@@ -145,6 +146,18 @@ define([
});
});
});
});
graphScenario
(
'when series is hidden'
,
function
(
ctx
)
{
ctx
.
setup
(
function
(
scope
)
{
scope
.
hiddenSeries
=
{
'series2'
:
true
};
});
it
(
'should remove datapoints and disable stack'
,
function
()
{
expect
(
ctx
.
plotData
[
0
].
info
.
alias
).
to
.
be
(
'series1'
);
expect
(
ctx
.
plotData
[
1
].
data
.
length
).
to
.
be
(
0
);
expect
(
ctx
.
plotData
[
1
].
stack
).
to
.
be
(
false
);
});
});
});
});
});
});
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