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/>'; });
edit: added line break measure =d
Comments
Post a Comment