我正在处理这个示例:http://www.highcharts.com/demo/combo
当我悬停在某个彩色饼图上时,即蓝色的工具提示是
Jane: 13 fruits然而,当我悬停到第一个colum (蓝色的苹果)时,工具提示是:
Apples: 3是简的苹果。那么,我如何将其更改为:
Jane : 3 apples有什么想法吗?
PS
示例中使用的工具提示格式化程序是:
tooltip: {
formatter: function() {
var s;
if (this.point.name) { // the pie chart
s = ''+
this.point.name +': '+ this.y +' fruits';
} else {
s = ''+
this.x +': '+ this.y;
}
return s;
}
}发布于 2012-09-03 23:57:47
您可以使用series获取this.series.someAttr数据。
因此,做以下几点:
formatter: function() {
var s;
if (this.point.name) { // the pie chart
s = this.point.name +' '+ this.y +' fruits';
} else {
s = this.series.name + ' : ' +
this.x +': '+ this.y;
}
return s;
}演示
发布于 2012-09-04 11:55:59
试试这个:
tooltip: {
formatter: function() {
var s;
if (this.point.name) { // the pie chart
s = ''+
this.point.name +': '+ this.y +' fruits';
} else {
s = ''+
this.series.name +': '+ this.y+' '+this.x;
}
return s;
}
}https://stackoverflow.com/questions/12255107
复制相似问题