gpt4 book ai didi

javascript - 如果 xAxis 勾选,Highchart 数据标 checkout 现在中间

转载 作者:行者123 更新时间:2023-11-30 20:08:52 25 4
gpt4 key购买 nike

请考虑这段代码:

plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2010
}
},

Demo 1

当 xAxis 类别是数字(年)时,数据标签与 xAxis 刻度对齐,但是当我更改类别并将其设置为某个字符串时,数据标签在 xAxis 刻度的中间对齐。

categories:["aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh"]

Demo 2

如何在 xAxis 刻度的顶部对齐值?

谢谢

最佳答案

您可以使用 tickmarkPlacement: 'on' ( API ) 设置来更正此问题。 API-说明:

For categorized axes only. If on the tick mark is placed in the center of the category, if between the tick mark is placed between categories. The default is between if the tickInterval is 1, else on.

例如:

xAxis: {
categories:["aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh"],
tickmarkPlacement: 'on'
}

参见 this JSFiddle demonstration它在使用中。

关于javascript - 如果 xAxis 勾选,Highchart 数据标 checkout 现在中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52604747/

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