gpt4 book ai didi

javascript - 在 Highcharts 的每个类别中放置一张图片

转载 作者:行者123 更新时间:2023-11-29 21:37:09 24 4
gpt4 key购买 nike

我有这个代码:

http://jsfiddle.net/waqLq62d/

让我知道如何将图片放在类别的开头。因此如图所示。

enter image description here

我不知道如何,非常感谢。

$('#container').highcharts({

xAxis: {
categories: [data.d[300].nomindicador, data.d[500].nomindicador, data.d[600].nomindicador,data.d[700].nomindicador, data.d[900].nomindicador],
title: {
text: null
},
labels: {

align: 'left',
x: 10,
y: -20

}

},
yAxis: {

title: {
text: 'Resultado',
align: 'right'
}

},
tooltip: {
valueSuffix: ' dollars'
},
plotOptions: {
bar: {
dataLabels: {
enabled: false
}
}
},
legend: {
layout: 'vertical',
align: 'center',
verticalAlign: 'bottom',
x: -40,
y:40 ,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
}

最佳答案

要实现这一点,您必须在 labels 对象上使用 useHTML 属性并将其设置为 true。

然后,您必须使用 format 属性在标签中插入 HTML 图像。

完整的工作示例在这里:

http://jsfiddle.net/u3o416xb/

代码应该是这样的:

labels: {
x: -5,
y: -20,
useHTML: true,
format: '<div style="position: absolute; left: 40px"> my label </div> <img style="height: 30px; width: 30px; margin-top: 10px" src="https://cdn2.iconfinder.com/data/icons/free-3d-printer-icon-set/512/Plastic_model.png"></img>'
}

enter image description here

关于javascript - 在 Highcharts 的每个类别中放置一张图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34573692/

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