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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
20 deletions
+13
-20
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
+11
-19
No files found.
public/app/plugins/panel/graph/axes_editor.ts
View file @
40e6317b
...
...
@@ -30,7 +30,7 @@ export class AxesEditorCtrl {
this
.
xAxisModes
=
{
'Time'
:
'time'
,
'Series'
:
'series'
,
'Data field'
:
'field'
,
//
'Data field': 'field',
};
this
.
xAxisStatOptions
=
[
...
...
public/app/plugins/panel/graph/data_processor.ts
View file @
40e6317b
...
...
@@ -68,6 +68,7 @@ export class DataProcessor {
this
.
panel
.
stack
=
false
;
this
.
panel
.
legend
.
show
=
false
;
this
.
panel
.
tooltip
.
shared
=
false
;
this
.
panel
.
xaxis
.
values
=
[
'total'
];
break
;
}
}
...
...
public/app/plugins/panel/graph/graph.ts
View file @
40e6317b
...
...
@@ -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
];
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
(
ctrl
.
hiddenSeries
[
series
.
alias
])
{
series
.
data
=
[];
...
...
@@ -265,6 +251,12 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
case
'series'
:
{
options
.
series
.
bars
.
barWidth
=
0.7
;
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
);
break
;
}
...
...
@@ -483,7 +475,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
var
defaults
=
{
position
:
'left'
,
show
:
panel
.
yaxes
[
0
].
show
,
//
min: panel.yaxes[0].min,
min
:
panel
.
yaxes
[
0
].
min
,
index
:
1
,
logBase
:
panel
.
yaxes
[
0
].
logBase
||
1
,
max
:
panel
.
percentage
&&
panel
.
stack
?
100
:
panel
.
yaxes
[
0
].
max
,
...
...
@@ -494,11 +486,11 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
if
(
_
.
find
(
data
,
{
yaxis
:
2
}))
{
var
secondY
=
_
.
clone
(
defaults
);
secondY
.
index
=
2
,
secondY
.
index
=
2
;
secondY
.
show
=
panel
.
yaxes
[
1
].
show
;
secondY
.
logBase
=
panel
.
yaxes
[
1
].
logBase
||
1
,
secondY
.
logBase
=
panel
.
yaxes
[
1
].
logBase
||
1
;
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
;
// autoscaleSpanOverride(panel.yaxes[1], data[1], 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