diff --git a/src/core.js b/src/core.js index 7a933d5..7f56945 100644 --- a/src/core.js +++ b/src/core.js @@ -547,14 +547,14 @@ c3_chart_internal_fn.redraw = function (options, transitions) { break; } } - $$.svg.selectAll('.' + CLASS.axisX + ' .tick text').each(function (e) { + $$.svg.selectAll('.' + CLASS.axisX + ' .tick').each(function (e) { var index = tickValues.indexOf(e); if (index >= 0) { - d3.select(this).style('display', index % intervalForCulling ? 'none' : 'block'); + d3.select(this).classed('culled', index % intervalForCulling); } }); } else { - $$.svg.selectAll('.' + CLASS.axisX + ' .tick text').style('display', 'block'); + $$.svg.selectAll('.' + CLASS.axisX + ' .tick').classed('culled', false); } } diff --git a/src/scss/axis.scss b/src/scss/axis.scss index 140ee4e..45dc8b5 100644 --- a/src/scss/axis.scss +++ b/src/scss/axis.scss @@ -1,4 +1,7 @@ .c3-axis-x .tick { + &.culled text { + display: none; + } } .c3-axis-x-label { }