mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Merge pull request #3941 from stormpython/fix/groupedBars
Fixes issue with incorrect offset for grouped bars
This commit is contained in:
commit
5c1d319fbc
3 changed files with 7 additions and 29 deletions
|
@ -335,9 +335,9 @@ define(function (require) {
|
|||
var line = svg.append('line')
|
||||
.attr('class', 'base-line')
|
||||
.attr('x1', 0)
|
||||
.attr('y1', height)
|
||||
.attr('y1', yScale(0))
|
||||
.attr('x2', width)
|
||||
.attr('y2', height)
|
||||
.attr('y2', yScale(0))
|
||||
.style('stroke', '#ddd')
|
||||
.style('stroke-width', 1);
|
||||
|
||||
|
|
|
@ -215,16 +215,7 @@ define(function (require) {
|
|||
return yScale(d.y);
|
||||
})
|
||||
.attr('height', function (d) {
|
||||
if (d.y < 0) {
|
||||
return Math.abs(yScale(0) - yScale(d.y));
|
||||
}
|
||||
|
||||
// if there is a negative yMin value, use yScale(0) instead of height
|
||||
if (yMin < 0) {
|
||||
return yScale(0) - yScale(d.y);
|
||||
}
|
||||
|
||||
return height - yScale(d.y);
|
||||
return Math.abs(yScale(0) - yScale(d.y));
|
||||
});
|
||||
|
||||
return bars;
|
||||
|
@ -315,25 +306,12 @@ define(function (require) {
|
|||
var line = svg.append('line')
|
||||
.attr('class', 'base-line')
|
||||
.attr('x1', 0)
|
||||
.attr('y1', height)
|
||||
.attr('y1', yScale(0))
|
||||
.attr('x2', width)
|
||||
.attr('y2', height)
|
||||
.attr('y2', yScale(0))
|
||||
.style('stroke', '#ddd')
|
||||
.style('stroke-width', 1);
|
||||
|
||||
if (yMin < 0) {
|
||||
|
||||
// Draw line at yScale 0 value
|
||||
svg.append('line')
|
||||
.attr('class', 'zero-line')
|
||||
.attr('x1', 0)
|
||||
.attr('y1', yScale(0))
|
||||
.attr('x2', width)
|
||||
.attr('y2', yScale(0))
|
||||
.style('stroke', '#ddd')
|
||||
.style('stroke-width', 1);
|
||||
}
|
||||
|
||||
if (addTimeMarker) {
|
||||
timeMarker.render(svg);
|
||||
}
|
||||
|
|
|
@ -334,9 +334,9 @@ define(function (require) {
|
|||
.append('line')
|
||||
.attr('class', 'base-line')
|
||||
.attr('x1', startLineX)
|
||||
.attr('y1', height)
|
||||
.attr('y1', yScale(0))
|
||||
.attr('x2', width)
|
||||
.attr('y2', height)
|
||||
.attr('y2', yScale(0))
|
||||
.style('stroke', '#ddd')
|
||||
.style('stroke-width', lineStrokeWidth);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue