highcharts - Shared tooltip with multiple stacks -
i've implemented stacked column chart 4 series divided on 2 stacks. want create tooltip each stack shows info series belong stack. when use shared: true
option tooltip formatter function, series in $.each(this.points, function(i, point) {})
loop.
how can create tooltip each stack, while still having access series in stack?
any advice appreciated.
you can use formatter , loop data y value.
tooltip: { formatter: function () { var indexs = this.series.index, indexp = this.point.x, series = this.series.chart.series, out = 'y1:' + this.y + '<br/>'; switch (indexs) { case 0: out += 'y2: ' + series[1].data[indexp].y; break; case 1: out += 'y2: ' +series[0].data[indexp].y; break; case 2: out += 'y2: ' +series[3].data[indexp].y; break; case 3: out += 'y2: ' + series[2].data[indexp].y; break; } return out; } },
Comments
Post a Comment