gpt4 book ai didi

css - 要对 Highcharts 词云中的某些词应用不同的字体样式?

转载 作者:行者123 更新时间:2023-11-28 01:56:56 25 4
gpt4 key购买 nike

以下 JS Fiddle 显示了应用于某些单词的字体样式。示例:https://jsfiddle.net/amrutaJgtp/7evd8tgo/5/

    {
"text": "UNKNOWN",
"count": 584,
"color": 'green',
"style": {
fontFamily: 'Harrington',
fontWeight: 1200 //font weight has no effect
}
}, {
"text": "OTHER",
"count": 138,
"color": 'red',
"style": {
fontFamily: 'sans - serif',
fontWeight: 1200 //font weight has no effect
}
}

我在 Highcharts 中试过这个。但它没有用。示例:https://jsfiddle.net/amrutaJgtp/7evd8tgo/6/

{
"name": "LANDING",
"weight": 18022,
"style":{
"fontFamily":"Harrington"
}
}

有没有办法对某些单词应用不同的字体样式?

最佳答案

API 没有说明wordcloud 系列 点的style 属性:https://api.highcharts.com/highcharts/series.wordcloud.data

您可以使用 className 代替:

JS:

var data = [{
"name": "LANDING",
"weight": 18022,
className: 'custom-point'
},
(...)]

CSS:

.custom-point {
font-family: Harrington !important
}

现场演示: https://jsfiddle.net/BlackLabel/Lpuyt1s7/

关于css - 要对 Highcharts 词云中的某些词应用不同的字体样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49572162/

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