From 9592e50c1bfb760ef69da2b4999ddc0582e135ee Mon Sep 17 00:00:00 2001 From: Roman Galochkin Date: Fri, 28 Feb 2020 13:49:39 +0300 Subject: [PATCH] Adds ticks --- src/components/charts/DistributionPlot/distPlotD3.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/charts/DistributionPlot/distPlotD3.js b/src/components/charts/DistributionPlot/distPlotD3.js index e781576d..7d21a632 100644 --- a/src/components/charts/DistributionPlot/distPlotD3.js +++ b/src/components/charts/DistributionPlot/distPlotD3.js @@ -337,11 +337,14 @@ export class CdfChartD3 { .domain([yMinDomain, yMaxDomain]) .range([this.calc.chartHeight, 0]); + const yTicks = Math.floor(this.calc.chartHeight / 20); + const yAxis = d3.axisLeft(yScale).ticks(yTicks); + // Adds 'g' for an y-axis. this.chart.append('g') .attr('class', 'lollipops-y-axis') .attr('transform', `translate(${this.calc.chartWidth}, 0)`) - .call(d3.axisLeft(yScale)); + .call(yAxis); function showTooltip(d) { d3.select('#lollipops-line-' + d.id)