gpt4 book ai didi

javascript - Highcharts 底部的副标题和标题

转载 作者:行者123 更新时间:2023-12-03 03:29:29 25 4
gpt4 key购买 nike

有没有一种干净的方法可以将标题和副标题放在 highcharts 图表的底部?

将两个 verticalAlign 设置为 bottom 时,字幕会与标题重叠,并且添加 y 偏移量会使其中一个或另一个溢出图表框的一部分,或与图表本身重叠。

默认行为:

为字幕添加 20px 偏移量:

我希望图表只需在底部留出空间,因为总高度和宽度已定义。

最佳答案

您只需在图表中添加 marginBottom 即可为标题腾出空间。此外,负 y 属性会将标题向上移动。

类似以下内容应该可以解决您的问题:

chart: {
type: 'pie',
marginBottom: 80
},
title: {
text: 'Main title',
verticalAlign: 'bottom',
y: -30
},
subtitle: {
text: 'My subtitle',
verticalAlign: 'bottom',
y: -10
}

this fiddle 中所述.

关于javascript - Highcharts 底部的副标题和标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46157697/

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