mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' into valuepanel
This commit is contained in:
commit
b0cf0c558d
@ -97,7 +97,7 @@ function (_, kbn) {
|
|||||||
result.push([currentTime * 1000, currentValue]);
|
result.push([currentTime * 1000, currentValue]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.length > 2) {
|
if (result.length >= 2) {
|
||||||
this.stats.timeStep = result[1][0] - result[0][0];
|
this.stats.timeStep = result[1][0] - result[0][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,8 +184,8 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.length && data[0].info.timeStep) {
|
if (data.length && data[0].stats.timeStep) {
|
||||||
options.series.bars.barWidth = data[0].info.timeStep / 1.5;
|
options.series.bars.barWidth = data[0].stats.timeStep / 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
addTimeAxis(options);
|
addTimeAxis(options);
|
||||||
|
@ -161,7 +161,7 @@ function ($) {
|
|||||||
|
|
||||||
value = series.formatValue(value);
|
value = series.formatValue(value);
|
||||||
timestamp = dashboard.formatDate(item.datapoint[0]);
|
timestamp = dashboard.formatDate(item.datapoint[0]);
|
||||||
group += ': <span class="graph-tooltip-value">' + value + '</span>';
|
group += ': <span class="graph-tooltip-value">' + value + '</span><br>';
|
||||||
|
|
||||||
self.showTooltip(timestamp, group, pos);
|
self.showTooltip(timestamp, group, pos);
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,20 @@ define([
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
graphScenario('should use timeStep for barWidth', function(ctx) {
|
||||||
|
ctx.setup(function(scope, data) {
|
||||||
|
scope.panel.bars = true;
|
||||||
|
data[0] = new TimeSeries({
|
||||||
|
datapoints: [[1,10],[2,20]],
|
||||||
|
info: { alias: 'series1', enable: true }
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set barWidth', function() {
|
||||||
|
expect(ctx.plotOptions.series.bars.barWidth).to.be(10000/1.5);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
graphScenario('series option overrides, fill & points', function(ctx) {
|
graphScenario('series option overrides, fill & points', function(ctx) {
|
||||||
ctx.setup(function(scope, data) {
|
ctx.setup(function(scope, data) {
|
||||||
scope.panel.lines = true;
|
scope.panel.lines = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user