Skip to content

Commit

Permalink
Reduced number of ticks provided as hint to d3.ticks (#1012)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shkr authored and mistercrunch committed Aug 25, 2016
1 parent e85978a commit 30071ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caravel/assets/visualizations/histogram.js
Expand Up @@ -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);

Expand Down

0 comments on commit 30071ee

Please sign in to comment.