我希望在每列的工具提示中显示多个序列数据
tooltip: {
formatter: function() {
return '<span style="color:#D31B22;font-weight:bold;">' +this.series.name +': '+ this.y +'<br/>'+
'<b style="color:#D31B22;font-weight:bold;">'+this.x +'</b><span>';
}
},
和数据
series: [{
showInLegend: false,
name: 'Total Click',
data: [3000,200,50,4000],
color: '#9D9D9D'
}, {
showInLegend: false,
name: 'Total View',
data: [100,2000,3000,4000],
color: '#D8D8D8'
}]
我是这样使用的,但在工具提示中,一次只显示一个序列数据。我想像这样显示数据(总视图:100,总点击:3000)
发布于 2013-10-11 16:51:16
您需要使用共享参数http://api.highcharts.com/highcharts#tooltip.shared,然后在格式中对每个点进行迭代。
发布于 2014-06-12 14:45:00
如果任何人正在寻找散点图,这里是显示共享工具提示的solution。
formatter: function(args) {
var this_point_index = this.series.data.indexOf( this.point );
var this_series_index = this.series.index;
var that_series_index = this.series.index == 0 ? 1 : 0; // assuming 2 series
var that_series = args.chart.series[that_series_index];
var that_point = that_series.data[this_point_index];
return 'Client: ' + this.point.name +
'<br/>Client Health: ' + this.x +
'<br/>' + this.series.name + ' Bandwidth: ' + this.y + 'Kbps' +
'<br/>' + that_series.name + ' Bandwidth: ' + that_point.y + 'Kbps';
}
https://stackoverflow.com/questions/19312312
复制相似问题