javascript - customize images and different text in Highcharts -
i'm new subject of highcarts. have message says "label" , figure categories. need customize individual image or text. how can this?
i have code:
labels: { x: -5, y: -20, usehtml: true, format: '<div style="position: absolute; left: 40px"> 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>' }
you can give label following way.
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>"; and custom image following way:
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>";
Comments
Post a Comment