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
799fd777
Commit
799fd777
authored
Jan 12, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added y format for right y axis
parent
85578f01
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
27 deletions
+36
-27
src/app/panels/graphite/module.js
+36
-27
No files found.
src/app/panels/graphite/module.js
View file @
799fd777
...
...
@@ -98,6 +98,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
* y_format:: 'none','bytes','short '
*/
y_format
:
'none'
,
y2_format
:
'none'
,
/** @scratch /panels/histogram/5
* grid object:: Min and max y-axis values
* grid.min::: Minimum y-axis value
...
...
@@ -583,14 +584,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
},
shadowSize
:
1
},
yaxes
:
[
{
position
:
'left'
,
show
:
scope
.
panel
[
'y-axis'
],
min
:
scope
.
panel
.
grid
.
min
,
max
:
scope
.
panel
.
percentage
&&
scope
.
panel
.
stack
?
100
:
scope
.
panel
.
grid
.
max
}
],
yaxes
:
[],
xaxis
:
{
timezone
:
scope
.
panel
.
timezone
,
show
:
scope
.
panel
[
'x-axis'
],
...
...
@@ -609,16 +603,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
}
};
if
(
scope
.
panel
.
y_format
===
'bytes'
)
{
options
.
yaxes
[
0
].
mode
=
"byte"
;
}
if
(
scope
.
panel
.
y_format
===
'short'
)
{
options
.
yaxes
[
0
].
tickFormatter
=
function
(
val
)
{
return
kbn
.
shortFormat
(
val
,
0
);
};
}
if
(
scope
.
panel
.
annotate
.
enable
)
{
options
.
events
=
{
levels
:
1
,
...
...
@@ -659,17 +643,10 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
var
_d
=
data
[
i
].
time_series
.
getFlotPairs
(
required_times
,
scope
.
panel
.
nullPointMode
);
data
[
i
].
yaxis
=
data
[
i
].
info
.
yaxis
;
data
[
i
].
data
=
_d
;
if
(
options
.
yaxes
.
length
===
1
&&
data
[
i
].
yaxis
===
2
)
{
options
.
yaxes
.
push
({
position
:
'right'
,
show
:
scope
.
panel
[
'y-axis'
],
min
:
scope
.
panel
.
grid
.
min
,
max
:
scope
.
panel
.
percentage
&&
scope
.
panel
.
stack
?
100
:
scope
.
panel
.
grid
.
max
});
}
}
configureAxisOptions
(
data
,
options
);
plot
=
$
.
plot
(
elem
,
data
,
options
);
if
(
scope
.
panel
.
leftYAxisLabel
)
{
...
...
@@ -684,6 +661,38 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
}
}
function
configureAxisOptions
(
data
,
options
)
{
var
defaults
=
{
position
:
'left'
,
show
:
scope
.
panel
[
'y-axis'
],
min
:
scope
.
panel
.
grid
.
min
,
max
:
scope
.
panel
.
percentage
&&
scope
.
panel
.
stack
?
100
:
scope
.
panel
.
grid
.
max
};
options
.
yaxes
.
push
(
defaults
);
if
(
_
.
findWhere
(
data
,
{
yaxis
:
2
}))
{
var
secondY
=
_
.
clone
(
defaults
);
secondY
.
position
=
'right'
;
options
.
yaxes
.
push
(
secondY
);
configureAxisMode
(
options
.
yaxes
[
1
],
scope
.
panel
.
y2_format
);
}
configureAxisMode
(
options
.
yaxes
[
0
],
scope
.
panel
.
y_format
);
}
function
configureAxisMode
(
axis
,
format
)
{
if
(
format
===
'bytes'
)
{
axis
.
mode
=
"byte"
;
}
if
(
format
===
'short'
)
{
axis
.
tickFormatter
=
function
(
val
)
{
return
kbn
.
shortFormat
(
val
,
0
);
};
}
}
function
time_format
(
interval
)
{
var
_int
=
kbn
.
interval_to_seconds
(
interval
);
if
(
_int
>=
2628000
)
{
...
...
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