我有这样的图形:https://www.highcharts.com/demo/column-stacked-percent
我的问题是,就像在示例中一样,工具提示位于每个栏的顶部。使用工具提示的定位器属性可以将其放置在某个位置,但是point.plotY属性始终为0。我认为这是因为工具提示是共享的。
当我悬停在顶部系列时,我需要将工具提示放在底部,因为我有一些信息隐藏在工具提示隐藏的条之间。我怎样才能得到这个point.plotY的“真正”值或者克服这个问题呢?
发布于 2017-07-10 17:04:13
当您有一个叠加柱时,您可以通过this.chart.hoverPoints (这是工具提示)获取悬停点,并从叠加柱中选择点。
如果想要一个特定点而不是悬停的列的一部分,可以通过this.chart.series[seriesIndex].data[pointIndex]访问系列对象及其。
显示在底点的工具提示的定位器:
positioner: function (w, h, p) {
const chart = this.chart
const points = chart.hoverPoints
if (points && points.length) {
const i = points.length - 1
return { x: points[i].plotX + chart.plotLeft - w / 2, y: points[i].plotY + chart.plotTop}
}
return { x: 0, y: -9e7 }
}https://stackoverflow.com/questions/45006359
复制相似问题