我的代码现在看起来像这样(下面的演示)
演示:http://jsfiddle.net/pintu31/AcNUM/2/
tooltip: {
formatter: function() {
var s = [];
$.each(this.points, function(i, point) {
s.push('<span style="color:#D31B22;font-weight:bold;">'+ point.series.name +' : '+
point.y +'<span>');
});
return s.join(' and ');
},
shared: true
},
当共享为假时,我仍然有指针箭头!如下所示: http://jsfiddle.net/AcNUM/259/
答案 0 :(得分:0)
使用格式化程序并定义应在工具提示中显示的内容。在格式化程序中,您可以找到与悬停点具有相同类别的点。
tooltip: {
formatter: function (tooltip) {
const series = this.series.chart.series.find(series => series !== this.series);
const point = series.points.find(point => point.category === this.x);
if (point !== undefined) {
return tooltip.defaultFormatter.call([point.getLabelConfig(), this], tooltip);
}
}
},