gpt4 book ai didi

javascript - 在 c3js 图表中重叠类别轴标签文本

转载 作者:行者123 更新时间:2023-11-29 18:10:08 26 4
gpt4 key购买 nike

如果 c3js 图表中的类别轴标签文本很长或有多个单词,它们会重叠并使其不可读,是否有任何配置或 hack 可以解决此问题?

c3js category axis label text overlapping

c3js category axis example

复制并粘贴以下代码以重现此错误。

var chart = c3.generate({
data: {
columns: [
['data1',40, 30, 200, 100, 400, 150, 250, 50, 100, 250,67,190,48,123,76,54,254]
]
},
axis: {
rotated: true,
x: {
type: 'category',
categories: ['Travel and Hospitality','Life Science and Pharma', 'Saas and Cloud', 'Hi-tech Manufacturing', 'Software', 'Business Services', 'Govt/Public Sector', 'Energy', 'Manufacturing', 'Healthcare','Media','Internet','Retail','Biotech','Automobile','Consumer Goods','Financial Services']
}
}
});

最佳答案

我在 axis_x_tick 下的“多行”配置中找到了解决方案,如下所示:-

axis: {
rotated: true,
x: {
tick: {
multiline: false,
},
type: 'category',
}
}

Working example- multiline axis label disabled

关于javascript - 在 c3js 图表中重叠类别轴标签文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28019036/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com