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
30d077d1
Commit
30d077d1
authored
Mar 13, 2018
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graph: minor refactor of histogram mode PR #8613
parent
38a19f7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
5 deletions
+1
-5
public/app/plugins/panel/graph/graph.ts
+1
-3
public/app/plugins/panel/graph/histogram.ts
+0
-2
No files found.
public/app/plugins/panel/graph/graph.ts
View file @
30d077d1
...
@@ -242,10 +242,8 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
...
@@ -242,10 +242,8 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
let
histMax
=
_
.
max
(
_
.
map
(
data
,
s
=>
s
.
stats
.
max
));
let
histMax
=
_
.
max
(
_
.
map
(
data
,
s
=>
s
.
stats
.
max
));
let
ticks
=
panel
.
xaxis
.
buckets
||
panelWidth
/
50
;
let
ticks
=
panel
.
xaxis
.
buckets
||
panelWidth
/
50
;
bucketSize
=
tickStep
(
histMin
,
histMax
,
ticks
);
bucketSize
=
tickStep
(
histMin
,
histMax
,
ticks
);
data
=
convertToHistogramData
(
data
,
bucketSize
,
ctrl
.
hiddenSeries
,
panel
.
stack
,
histMin
,
histMax
);
options
.
series
.
bars
.
barWidth
=
bucketSize
*
0.8
;
options
.
series
.
bars
.
barWidth
=
bucketSize
*
0.8
;
data
=
convertToHistogramData
(
data
,
bucketSize
,
ctrl
.
hiddenSeries
,
histMin
,
histMax
);
}
else
{
}
else
{
bucketSize
=
0
;
bucketSize
=
0
;
}
}
...
...
public/app/plugins/panel/graph/histogram.ts
View file @
30d077d1
...
@@ -59,13 +59,11 @@ export function convertValuesToHistogram(values: number[], bucketSize: number, m
...
@@ -59,13 +59,11 @@ export function convertValuesToHistogram(values: number[], bucketSize: number, m
* Convert series into array of histogram data.
* Convert series into array of histogram data.
* @param data Array of series
* @param data Array of series
* @param bucketSize
* @param bucketSize
* @param stack
*/
*/
export
function
convertToHistogramData
(
export
function
convertToHistogramData
(
data
:
any
,
data
:
any
,
bucketSize
:
number
,
bucketSize
:
number
,
hiddenSeries
:
any
,
hiddenSeries
:
any
,
stack
=
false
,
min
:
number
,
min
:
number
,
max
:
number
max
:
number
):
any
[]
{
):
any
[]
{
...
...
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