gpt4 book ai didi

javascript - Highcharts 7 - 居中注释

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

我想要在我的 Highchart 上某些数据的顶部显示一个注释。我已经在我的数据位置添加了注释,但是它从我的数据点的中心开始。但是我希望注释以点为中心。请参阅下面的图片和 Plnkr。

我有什么 enter image description here

我想要什么 enter image description here http://next.plnkr.co/edit/hHGxXF3pRs7j9M8a

最佳答案

默认情况下,黑线您提供的值的中间开始;在你的例子中是“1547442017000”;但是由于我们不希望黑线覆盖黄线...您可以将其拉回,但将其拉回任意数字是行不通的,因为屏幕尺寸会影响该值;

所以我们采用不同的方法,我们增加笔划的大小(使用下面的 strokeWidth 值),以便该值仍然指向“1547442017000”...我们只是增加笔划大小。

complete working example

相关代码:

annotations: [
{
shapes: [{
point: {
xAxis: 0,
yAxis: 0,
x: 1547442017000, y: 1
},
type: 'rect',
height: 355,
width: 0.01,
fill: 'rgba(0, 0, 0, 0.75)',
stroke: 'rgba(0, 0, 0, 0.75)',
strokeWidth: 20
}]
}]

关于javascript - Highcharts 7 - 居中注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54453827/

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