gpt4 book ai didi

javascript - 在 highcharts 中使用动态 html 渲染标题

转载 作者:行者123 更新时间:2023-12-03 00:07:16 24 4
gpt4 key购买 nike

我必须在图表后面的空格中添加一个数字。像这样的事情

enter image description here

这是Fiddle

这是我的代码

  title: {
text: title,
align: 'left',
x: 10,
style: {
color: '#000000',
fontSize: '20px',
fontWeight: '600',
lineHeight: '29px'
},
},
subtitle: {
text: subtitle,
align: 'left',
x: 10,
style: {
color: '#4A4A4A',
fontSize: '14px',

},
y: 50,
},

我怎样才能做到这一点?

最佳答案

您可以使用Highcharts.SVGRenderer.text添加文本。检查下面发布的代码和演示。

代码:

  chart: {
type: 'areaspline',
width: 300,
height: 275,
events: {
load: function() {
var chart = this,
number = 853;

chart.renderer.text(number, 50, 70)
.css({
color: '#8b8bff',
fontSize: 26,
fontWeight: 'bold'
})
.add()
.toFront();
}
}
}

演示:

API引用:

关于javascript - 在 highcharts 中使用动态 html 渲染标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54904471/

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