javascript - Shared tooltips on a pie in a donut? -


i'm fussing pie in donut in highcharts, , can't seem either legend or shared tooltip appear. works fine with non-shared tooltips:

tooltip: {             formatter: function () {                 return this.point.name + ': ' +this.y                      + ' units (' + highcharts.numberformat(this.percentage, 0) + '%)'                 ;                },         }, 

but if try transform shared tooltip, nothing appears.

    tooltip: {         formatter: function () {             var s = this.series.name + this.point.name;             $.each(this.points, function (i, point) {                 s += point.name + ' ' + point.y + ' ' + point.percentage;             });             return s;         },         shared: true     }, 

i can't figure out i'm doing wrong.

just took @ highcharts (this) object in formatter function. not sure you're trying accomplish, looks highcharts object holds series array of points:

$.each(this.series.points, function (i, point) {     s += point.name + ' ' + point.y + ' ' + point.percentage + '<br/>'; }); 

fiddle

edit: added line break measure =d


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -