Skip to content

Commit

Permalink
fixing issue with monthly and yearly date selection; complements issue
Browse files Browse the repository at this point in the history
  • Loading branch information
stormpython committed Jun 20, 2014
1 parent 58cb92a commit fb16d1d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/kibana/components/vislib/modules/histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,11 @@ define(function (require) {

if (milsInterval >= 86400000 * 364) {
testInterval = 'year';
dateoffset = (milsInterval / 86400000 * 364);
dateoffset = 1;
}
if (milsInterval < 86400000 * 364) {
testInterval = 'month';
dateoffset = (milsInterval / 86400000 * 30);
dateoffset = 1;
}
if (milsInterval < 86400000 * 30) {
testInterval = 'week';
Expand Down Expand Up @@ -533,7 +533,7 @@ define(function (require) {
var tickScale = d3.scale.linear()
.clamp(true)
.domain([20, 40, 1000])
.range([0, 1, 10]),
.range([0, 2, 10]),
tickN = Math.floor(tickScale(height));

var yAxis = d3.svg.axis()
Expand Down Expand Up @@ -896,17 +896,18 @@ define(function (require) {
if (data.ordered === undefined || !data.ordered.date) {
val = xScale.rangeBand();
} else {
val = xScale(data.ordered.min + data.ordered.interval) - xScale(data.ordered.min) - 2;
val = xScale(data.ordered.min + data.ordered.interval) -
xScale(data.ordered.min) - 2;
}
if (isNaN(val) || val <= 0) {
if (isNaN(val) || val < 0) {
throw new Error('line 894: bars attr width: ' + val);
} else {
return val;
}
})
.attr('y', function (d) {
var val = yScale(d.y0 + d.y);
if (isNaN(val) || val <= 0) {
if (isNaN(val) || val < 0) {
throw new Error('line 907: bars attr y: ' + val);
} else {
return val;
Expand Down

0 comments on commit fb16d1d

Please sign in to comment.