问题
I have a stackedAreaChart in d3.js
X-axis labels are 9 dates which I have formatted using tickFormat method. However, I want chart to take each date. Currently it takes every 2nd date.
var dates = ["Jun 07","Jun 08","Jun 09","Jun 10","Jun 11","Jun 12","Jun 13"];
chart.xAxis.ticks(9);
chart.xAxis
.tickFormat(function(d,e,f) {
if(d===1||d==7){
return ''
}
return dates[d-1];
});
How can I do that?
Thanks!
来源:https://stackoverflow.com/questions/26549761/specify-x-axis-labels-in-d3