隐藏轴刻度值

nar*_*esh 2 d3.js c3.js

有没有办法在 c3js(0.1.42 版)中隐藏轴刻度值?在其中一张图中,我有带有长刻度值的分类轴。我想隐藏它们并仅在鼠标悬停时显示。我已经尝试了http://c3js.org/samples/axes_x_tick_culling.html 中提到的刻度剔除选项(通过将 max 设置为 0),但它不起作用。

Che*_*tan 5

你可以试试这个:

在 tick format() 方法中返回空字符串,如下所示:-

axis : {
    x : {
        type : 'categorized',
        tick: {
            format: function (x) { return ''; }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)