期望

共享系列有独立的位置工具提示

试过了

根据Highcharts文档,我知道Highcharts.tooltip.positioner可以对工具提示进行一些自定义,但是当我四处搜索时,它们全都是未拆分的工具提示。并在拆分情况下失败,因此可以自定义拆分工具提示位置吗?

http://jsfiddle.net/TabGre/fyxqsq4L/

UPD:

每个点的工具提示就在其上方,就像positioner一样:

positioner: function () {
  return {
    x: this.plotX;
    y: this.plotY + 100;
  }
}

最佳答案

正如我在评论中提到的,当前定位器回调不影响拆分工具提示。但是,可以覆盖负责渲染拆分工具提示的功能。它需要自己计算位置。

如果您希望像fiddle一样在左上角显示拆分工具提示
您需要用每个框的所需位置覆盖Highcharts.Tooltip.prototype.renderSplit = function(labels, points)

  var yPos = 0;

            each(boxes, function(box, i) {
                var point = box.point,
                    series = point.series;

                // Put the label in place
                box.tt.attr({
                 //   visibility: box.pos === undefined ? 'hidden' : 'inherit',
                    x: (rightAligned || point.isHeader ?
                        //box.x :
                        0 :
                        point.plotX + chart.plotLeft + pick(options.distance, 16)),
                  //  y: box.pos + chart.plotTop,
                    y: yPos,
                    anchorX: point.isHeader ?
                        point.plotX + chart.plotLeft : point.plotX + series.xAxis.pos,
                    anchorY: point.isHeader ?
                        box.pos + chart.plotTop - 15 : point.plotY + series.yAxis.pos
                });
                yPos += box.size;
            });


例如:http://jsfiddle.net/tbguemvL/

10-04 15:40
查看更多