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
f16e3e38
Commit
f16e3e38
authored
May 29, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v4.3.x'
parents
5e0b0392
d318c909
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
public/app/plugins/panel/graph/graph.ts
+12
-5
public/app/plugins/panel/graph/specs/graph_specs.ts
+23
-0
No files found.
public/app/plugins/panel/graph/graph.ts
View file @
f16e3e38
...
...
@@ -555,12 +555,19 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
return
;
}
axis
.
ticks
=
[];
var
nextTick
;
for
(
nextTick
=
min
;
nextTick
<=
max
;
nextTick
*=
axis
.
logBase
)
{
axis
.
ticks
.
push
(
nextTick
);
if
(
Number
.
isFinite
(
min
)
&&
Number
.
isFinite
(
max
))
{
axis
.
ticks
=
[];
var
nextTick
;
for
(
nextTick
=
min
;
nextTick
<=
max
;
nextTick
*=
axis
.
logBase
)
{
axis
.
ticks
.
push
(
nextTick
);
}
axis
.
tickDecimals
=
decimalPlaces
(
min
);
}
else
{
axis
.
ticks
=
[
1
,
2
];
delete
axis
.
min
;
delete
axis
.
max
;
}
axis
.
tickDecimals
=
decimalPlaces
(
min
);
}
function
decimalPlaces
(
num
)
{
...
...
public/app/plugins/panel/graph/specs/graph_specs.ts
View file @
f16e3e38
...
...
@@ -153,6 +153,29 @@ describe('grafanaGraph', function() {
});
});
graphScenario
(
'when logBase is log 10 and data points contain only zeroes'
,
function
(
ctx
)
{
ctx
.
setup
(
function
(
ctrl
,
data
)
{
ctrl
.
panel
.
yaxes
[
0
].
logBase
=
10
;
data
[
0
]
=
new
TimeSeries
({
datapoints
:
[[
0
,
1
],[
0
,
2
],[
0
,
3
],[
0
,
4
]],
alias
:
'seriesAutoscale'
,
});
data
[
0
].
yaxis
=
1
;
});
it
(
'should not set min and max and should create some fake ticks'
,
function
()
{
var
axisAutoscale
=
ctx
.
plotOptions
.
yaxes
[
0
];
expect
(
axisAutoscale
.
transform
(
100
)).
to
.
be
(
2
);
expect
(
axisAutoscale
.
inverseTransform
(
-
3
)).
to
.
be
(
0.001
);
expect
(
axisAutoscale
.
min
).
to
.
be
(
undefined
);
expect
(
axisAutoscale
.
max
).
to
.
be
(
undefined
);
expect
(
axisAutoscale
.
ticks
.
length
).
to
.
be
(
2
);
expect
(
axisAutoscale
.
ticks
[
0
]).
to
.
be
(
1
);
expect
(
axisAutoscale
.
ticks
[
1
]).
to
.
be
(
2
);
expect
(
axisAutoscale
.
tickDecimals
).
to
.
be
(
undefined
);
});
});
graphScenario
(
'dashed lines options'
,
function
(
ctx
)
{
ctx
.
setup
(
function
(
ctrl
)
{
ctrl
.
panel
.
lines
=
true
;
...
...
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