I'm trying to format the y-axis number values to 1, 10, 100, 1,000, 10,000, and while the formatted values are displayed as hoped, I can't find a way to show only some of the tick labels. The goal is to show just 10, 100, 1,000 etc. and not 20, 30, 40, 50, 60, etc.
Using dc.js and crossfilter to define the dimensions and grouping:
var lineChart = dc.lineChart("#dc-line-chart");
lineChart
.width(500)
.height(500)
.margins({top: 10, right: 50, bottom: 30, left: 40})
.dimension(yearValue)
.group(yearValueGroup)
.brushOn(false)
.renderHorizontalGridLines(true)
.renderVerticalGridLines(true)
.y(d3.scale.log().domain([.5, 1000000]))
.x(d3.scale.linear().domain([2000, 2050]))
.yAxis().tickFormat(d3.format(",.0f"));
I've seen examples of custom javascript solutions, but it seems there has to be a simpler solution. Any help is much appreciated.