Commit f1bc8eeb by Rashid Khan

Made histogram show entire range during loading. Fixed since/absolute time ranges

parent fcffe102
......@@ -89,7 +89,7 @@ angular.module('kibana.histogram', [])
_.each(results.facets, function(v, k) {
// Null values at each end of the time range ensure we see entire range
if(_.isUndefined($scope.data[k]) || _segment == 0) {
var data = [[$scope.time.to.getTime(), null]];
var data = [[$scope.time.from.getTime(), null],[$scope.time.to.getTime(), null]];
} else {
var data = $scope.data[k].data
}
......@@ -99,10 +99,7 @@ angular.module('kibana.histogram', [])
segment_data.push([v['time'],v['count']])
});
data = segment_data.concat(data)
if(_segment == $scope.panel.index.length-1)
data.unshift([$scope.time.from.getTime(), null])
data.splice.apply(data,[1,0].concat(segment_data))
var series = {
data: {
......
......@@ -136,11 +136,12 @@ angular.module('kibana.timepicker', [])
}
$scope.time_check = function(){
if(!(_.isUndefined($scope.timepicker))) {
var from = $scope.panel.mode === 'relative' ? time_ago($scope.panel.timespan) :
Date.parse($scope.timepicker.from.date + " " + $scope.timepicker.from.time)
new Date(Date.parse($scope.timepicker.from.date + " " + $scope.timepicker.from.time))
var to = $scope.panel.mode !== 'absolute' ? new Date() :
Date.parse($scope.timepicker.to.date + " " + $scope.timepicker.to.time)
new Date(Date.parse($scope.timepicker.to.date + " " + $scope.timepicker.to.time))
} else {
var from = $scope.panel.mode === 'relative' ? time_ago($scope.panel.timespan) :
$scope.time.from;
......
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