我对高脚车这个话题很陌生。我有一条信息,上面写着“标签”和所有类别的数字。我需要定制个人形象或文字。我该怎么做?
我有这样的代码:
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>'
}发布于 2016-01-06 04:46:49
你可以按下面的方式给标签。
formatter: function () { return "<div style='position: absolute; left: 40px'>'"+ this.value + "'</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>";以及自定义图像,如下所示:
var categoryImgs = {
'number1':'http://i.stack.imgur.com/Tdw3H.png',
'number2':'http://i.stack.imgur.com/Tdw3H.png',
'number3':'http://i.stack.imgur.com/Tdw3H.png',
'number4':'http://i.stack.imgur.com/Tdw3H.png',
'number5':'http://i.stack.imgur.com/Tdw3H.png'
};
formatter: function () { return "<div style='position: absolute; left: 40px'>'"+ this.value + "'</div> <img style='height: 30px; width: 30px; margin-top: 10px' src='"+categoryImgs[this.value]+"'></img>";https://stackoverflow.com/questions/34625661
复制相似问题