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
40e6317b
Commit
40e6317b
authored
Sep 26, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(graph): refactoring
parent
acfde82c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
22 deletions
+15
-22
public/app/plugins/panel/graph/axes_editor.ts
+1
-1
public/app/plugins/panel/graph/data_processor.ts
+1
-0
public/app/plugins/panel/graph/graph.ts
+13
-21
No files found.
public/app/plugins/panel/graph/axes_editor.ts
View file @
40e6317b
...
@@ -30,7 +30,7 @@ export class AxesEditorCtrl {
...
@@ -30,7 +30,7 @@ export class AxesEditorCtrl {
this
.
xAxisModes
=
{
this
.
xAxisModes
=
{
'Time'
:
'time'
,
'Time'
:
'time'
,
'Series'
:
'series'
,
'Series'
:
'series'
,
'Data field'
:
'field'
,
//
'Data field': 'field',
};
};
this
.
xAxisStatOptions
=
[
this
.
xAxisStatOptions
=
[
...
...
public/app/plugins/panel/graph/data_processor.ts
View file @
40e6317b
...
@@ -68,6 +68,7 @@ export class DataProcessor {
...
@@ -68,6 +68,7 @@ export class DataProcessor {
this
.
panel
.
stack
=
false
;
this
.
panel
.
stack
=
false
;
this
.
panel
.
legend
.
show
=
false
;
this
.
panel
.
legend
.
show
=
false
;
this
.
panel
.
tooltip
.
shared
=
false
;
this
.
panel
.
tooltip
.
shared
=
false
;
this
.
panel
.
xaxis
.
values
=
[
'total'
];
break
;
break
;
}
}
}
}
...
...
public/app/plugins/panel/graph/graph.ts
View file @
40e6317b
...
@@ -236,24 +236,10 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
...
@@ -236,24 +236,10 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
}
}
};
};
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
series
=
data
[
i
];
var
series
=
data
[
i
];
series
.
data
=
series
.
getFlotPairs
(
series
.
nullPointMode
||
panel
.
nullPointMode
);
series
.
data
=
series
.
getFlotPairs
(
series
.
nullPointMode
||
panel
.
nullPointMode
);
if
(
panel
.
xaxis
.
mode
===
'series'
)
{
series
.
data
=
[[
i
+
1
,
series
.
stats
[
panel
.
xaxis
.
values
[
0
]]]];
}
else
if
(
panel
.
xaxis
.
mode
===
'table'
||
panel
.
xaxis
.
mode
===
'elastic'
)
{
series
.
data
=
[];
for
(
var
j
=
0
;
j
<
series
.
datapoints
.
length
;
j
++
)
{
var
dataIndex
=
i
*
series
.
datapoints
.
length
+
j
;
series
.
datapoints
[
j
];
series
.
data
.
push
([
dataIndex
+
1
,
series
.
datapoints
[
j
][
0
]
]);
}
}
// if hidden remove points and disable stack
// if hidden remove points and disable stack
if
(
ctrl
.
hiddenSeries
[
series
.
alias
])
{
if
(
ctrl
.
hiddenSeries
[
series
.
alias
])
{
series
.
data
=
[];
series
.
data
=
[];
...
@@ -265,6 +251,12 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
...
@@ -265,6 +251,12 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
case
'series'
:
{
case
'series'
:
{
options
.
series
.
bars
.
barWidth
=
0.7
;
options
.
series
.
bars
.
barWidth
=
0.7
;
options
.
series
.
bars
.
align
=
'center'
;
options
.
series
.
bars
.
align
=
'center'
;
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
series
=
data
[
i
];
series
.
data
=
[[
i
+
1
,
series
.
stats
[
panel
.
xaxis
.
values
[
0
]]]];
}
addXSeriesAxis
(
options
);
addXSeriesAxis
(
options
);
break
;
break
;
}
}
...
@@ -483,7 +475,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
...
@@ -483,7 +475,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
var
defaults
=
{
var
defaults
=
{
position
:
'left'
,
position
:
'left'
,
show
:
panel
.
yaxes
[
0
].
show
,
show
:
panel
.
yaxes
[
0
].
show
,
//
min: panel.yaxes[0].min,
min
:
panel
.
yaxes
[
0
].
min
,
index
:
1
,
index
:
1
,
logBase
:
panel
.
yaxes
[
0
].
logBase
||
1
,
logBase
:
panel
.
yaxes
[
0
].
logBase
||
1
,
max
:
panel
.
percentage
&&
panel
.
stack
?
100
:
panel
.
yaxes
[
0
].
max
,
max
:
panel
.
percentage
&&
panel
.
stack
?
100
:
panel
.
yaxes
[
0
].
max
,
...
@@ -494,11 +486,11 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
...
@@ -494,11 +486,11 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
if
(
_
.
find
(
data
,
{
yaxis
:
2
}))
{
if
(
_
.
find
(
data
,
{
yaxis
:
2
}))
{
var
secondY
=
_
.
clone
(
defaults
);
var
secondY
=
_
.
clone
(
defaults
);
secondY
.
index
=
2
,
secondY
.
index
=
2
;
secondY
.
show
=
panel
.
yaxes
[
1
].
show
;
secondY
.
show
=
panel
.
yaxes
[
1
].
show
;
secondY
.
logBase
=
panel
.
yaxes
[
1
].
logBase
||
1
,
secondY
.
logBase
=
panel
.
yaxes
[
1
].
logBase
||
1
;
secondY
.
position
=
'right'
;
secondY
.
position
=
'right'
;
//
secondY.min = panel.yaxes[1].min;
secondY
.
min
=
panel
.
yaxes
[
1
].
min
;
secondY
.
max
=
panel
.
percentage
&&
panel
.
stack
?
100
:
panel
.
yaxes
[
1
].
max
;
secondY
.
max
=
panel
.
percentage
&&
panel
.
stack
?
100
:
panel
.
yaxes
[
1
].
max
;
// autoscaleSpanOverride(panel.yaxes[1], data[1], secondY);
// autoscaleSpanOverride(panel.yaxes[1], data[1], secondY);
options
.
yaxes
.
push
(
secondY
);
options
.
yaxes
.
push
(
secondY
);
...
...
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