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
ad78e3a4
Commit
ad78e3a4
authored
Oct 12, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skeleton for default flot pairs
parent
19dc44df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
src/app/panels/histogram/timeSeries.js
+22
-0
No files found.
src/app/panels/histogram/timeSeries.js
View file @
ad78e3a4
...
@@ -99,6 +99,8 @@ function (_, Interval) {
...
@@ -99,6 +99,8 @@ function (_, Interval) {
if
(
this
.
opts
.
fill_style
===
'all'
)
{
if
(
this
.
opts
.
fill_style
===
'all'
)
{
strategy
=
this
.
_getAllFlotPairs
;
strategy
=
this
.
_getAllFlotPairs
;
}
else
if
(
this
.
opts
.
fill_style
=
'default'
)
{
strategy
=
this
.
_getDefaultFlotPairs
;
}
else
{
}
else
{
strategy
=
this
.
_getMinFlotPairs
;
strategy
=
this
.
_getMinFlotPairs
;
}
}
...
@@ -112,6 +114,7 @@ function (_, Interval) {
...
@@ -112,6 +114,7 @@ function (_, Interval) {
// if the first or last pair is inside either the start or end time,
// if the first or last pair is inside either the start or end time,
// add those times to the series with null values so the graph will stretch to contain them.
// add those times to the series with null values so the graph will stretch to contain them.
// Not sure this is required with flot 0.8.1's min/max params. Might be harmful?
if
(
this
.
start_time
&&
(
pairs
.
length
===
0
||
pairs
[
0
][
0
]
>
this
.
start_time
))
{
if
(
this
.
start_time
&&
(
pairs
.
length
===
0
||
pairs
[
0
][
0
]
>
this
.
start_time
))
{
pairs
.
unshift
([
this
.
start_time
,
null
]);
pairs
.
unshift
([
this
.
start_time
,
null
]);
}
}
...
@@ -174,6 +177,24 @@ function (_, Interval) {
...
@@ -174,6 +177,24 @@ function (_, Interval) {
return
result
;
return
result
;
};
};
/**
* ** called as a reduce stragegy in getFlotPairs() **
* Does no zero filling
* @return {array} An array of points to plot with flot
*/
ts
.
ZeroFilled
.
prototype
.
_getDefaultFlotPairs
=
function
(
result
,
time
,
i
,
times
)
{
var
next
,
expected_next
;
result
.
push
([
times
[
i
],
this
.
_data
[
times
[
i
]]
||
0
]);
next
=
times
[
i
+
1
];
expected_next
=
this
.
interval
.
after
(
time
);
for
(;
times
.
length
>
i
&&
next
>
expected_next
;
expected_next
=
this
.
interval
.
after
(
expected_next
))
{
result
.
push
([
expected_next
,
0
]);
}
return
result
;
};
return
ts
;
return
ts
;
});
});
\ No newline at end of file
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