From a2c5eaac89b76e80e027608455b95fb922ad74d8 Mon Sep 17 00:00:00 2001 From: Roman Galochkin Date: Mon, 2 Mar 2020 08:47:04 +0300 Subject: [PATCH] Fixes rectangles --- src/components/charts/DistributionPlot/distPlotD3.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/charts/DistributionPlot/distPlotD3.js b/src/components/charts/DistributionPlot/distPlotD3.js index d4edb40b..47f39133 100644 --- a/src/components/charts/DistributionPlot/distPlotD3.js +++ b/src/components/charts/DistributionPlot/distPlotD3.js @@ -169,7 +169,7 @@ export class CdfChartD3 { const areaColorRange = d3.scaleOrdinal().range(this.attrs.areaColors); const dataPoints = [this.getDataPoints('continuous')]; - const { xMin, xMax, xScale, yScale } = common; + const { xMin, xMax, xScale, yScale } = common; // X-axis. let xAxis = null; @@ -403,9 +403,9 @@ export class CdfChartD3 { .enter() .append('rect') .attr('width', 30) - .attr('height', this.calc.chartHeight) + .attr('height', d => this.calc.chartHeight - yScale(d.y) + 10) .attr('x', d => common.xScale(d.x) - 15) - .attr('y', 0) + .attr('y', d => yScale(d.y) - 10) .attr('opacity', 0) .attr('pointer-events', 'all') .on('mouseover', showTooltip)