Commit e51525db by Ben RUBSON Committed by Torkel Ödegaard

Only take bar series to calculate barWidth (#6756)

* Only take bar series to calculate barWidth

solves #6751

* Typo

* Typo

* Typo

* Typo

* Refactor

* Simplify
parent 5f6a3ecd
...@@ -185,6 +185,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) { ...@@ -185,6 +185,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
// Series could have different timeSteps, // Series could have different timeSteps,
// let's find the smallest one so that bars are correctly rendered. // let's find the smallest one so that bars are correctly rendered.
// In addition, only take series which are rendered as bars for this.
function getMinTimeStepOfSeries(data) { function getMinTimeStepOfSeries(data) {
var min = Number.MAX_VALUE; var min = Number.MAX_VALUE;
...@@ -192,6 +193,15 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) { ...@@ -192,6 +193,15 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
if (!data[i].stats.timeStep) { if (!data[i].stats.timeStep) {
continue; continue;
} }
if (panel.bars) {
if (data[i].bars && data[i].bars.show === false) {
continue;
}
} else {
if (typeof data[i].bars === 'undefined' || typeof data[i].bars.show === 'undefined' || !data[i].bars.show) {
continue;
}
}
if (data[i].stats.timeStep < min) { if (data[i].stats.timeStep < min) {
min = data[i].stats.timeStep; min = data[i].stats.timeStep;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment