Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 highcharts.js 库绘制了一个图表。我想要xAxis一点点定制。我想显示标签,xAxis但我想显示和隐藏备用标签。我的意思是我想显示 1,3,5 等标签。将绘制数字 2.4.6,但不会显示标签。
xAxis
您还可以将tickInterval设置为 2。
您在 x 轴标签属性中有一个名为step的选项,要仅显示轴上的每n 个 标签,请将 step 设置为 n。
在您的情况下,将步骤设置为 2(如下所示)显示所有其他标签。
xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr'], labels: { step: 2 } }
查找示例here并帮助自己使用 API here。
here