This commit is contained in:
Tyler Wolf 2012-11-12 18:23:01 -05:00
parent 36a242846a
commit 49505ba976
3 changed files with 13 additions and 7 deletions

View File

@ -1893,7 +1893,10 @@ nv.models.cumulativeLineChart = function() {
xAxis
.scale(x)
.ticks( availableWidth / 100 )
//If the ticks cannot fit on the chart tastefully, put in subticks for the dates that don't show
.tickSubdivide( (data[0].values.length > (availableWidth/50)) ? true : false )
//Suggest how many ticks based on the chart width and D3 should listen (50 is the optimal number for MM/DD/YY dates)
.ticks( Math.min(data[0].values.length,availableWidth/50) )
.tickSize(-availableHeight, 0);
g.select('.nv-x.nv-axis')

10
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -275,7 +275,10 @@ nv.models.cumulativeLineChart = function() {
xAxis
.scale(x)
.ticks( availableWidth / 100 )
//If the ticks cannot fit on the chart tastefully, put in subticks for the dates that don't show
.tickSubdivide( (data[0].values.length > (availableWidth/50)) ? true : false )
//Suggest how many ticks based on the chart width and D3 should listen (50 is the optimal number for MM/DD/YY dates)
.ticks( Math.min(data[0].values.length,availableWidth/50) )
.tickSize(-availableHeight, 0);
g.select('.nv-x.nv-axis')