From 30071eef09533d142733e2e907d872d2e772e981 Mon Sep 17 00:00:00 2001 From: Shashank Shekhar Date: Thu, 25 Aug 2016 08:18:22 -0700 Subject: [PATCH] Reduced number of ticks provided as hint to d3.ticks (#1012) The number of the ticks suggested scales with 3 times as much as the number of bins. This is unwanted since the number of ticks is a hint to d3 as per (https://github.com/d3/d3-3.x-api-reference/blob/master/Quantitative-Scales.md#identity_ticks) The high number of suggesting ticks leads to a congested y-axis. --- caravel/assets/visualizations/histogram.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caravel/assets/visualizations/histogram.js b/caravel/assets/visualizations/histogram.js index 0cc247b73bd74..cfb58fab9eebc 100644 --- a/caravel/assets/visualizations/histogram.js +++ b/caravel/assets/visualizations/histogram.js @@ -32,7 +32,7 @@ function histogram(slice) { const yAxis = d3.svg.axis() .scale(y) .orient('left') - .ticks(numBins * 3); + .ticks(numBins); // Calculate bins for the data const bins = d3.layout.histogram().bins(numBins)(data);