highcharts - Highcarts custom legend -


how can customize legends

from

custom

to this

desired

check highcharts legend api options.you can further customize desired css. use proper svg image (background color taken chart itself)

legend: {   align: 'right',   verticalalign: 'top',   layout: 'vertical',   x: -50,   y: 120,   symbolpadding: 0,   symbolwidth: 0.1,   symbolheight: 0.1,   symbolradius: 0,   usehtml: true,   symbolwidth: 0,   labelformatter: function() {     if(this.name=="microsoft internet explorer"){          return '<div style="width:200px;"><span style="float:left; margin-left:10px"><img src = "http://cdn.onlinewebfonts.com/svg/img_508736.svg" width = "40px" height = "40px" style="background-color:' + this.color + ';"></span><span style="float:right;padding:9px">' + this.percentage.tofixed(2) + " " + this.y + '%</span></div>';     }    if(this.name=="chrome"){    return '<div style="width:200px;"><span style="float:left; margin-left:10px"><img src = "http://cdn.onlinewebfonts.com/svg/img_159842.svg" width = "40px" height = "40px" style="background-color:' + this.color + ';"></span><span style="float:right;padding:9px">' + this.percentage.tofixed(2) + " " + this.y + '%</span></div>';    }    if(this.name=="firefox"){    return '<div style="width:200px;"><span style="float:left; margin-left:10px"><img src = "http://cdn.onlinewebfonts.com/svg/img_261106.svg" width = "40px" height = "40px" style="background-color:' + this.color + ';"></span><span style="float:right;padding:9px">' + this.percentage.tofixed(2) + " " + this.y + '%</span></div>';    }    },   itemstyle: {     color: '#ffffff',     fontweight: 'bold',     fontsize: '19px'   } }, 

fiddle demo


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -