我想添加一個圖像的工具提示到甜甜圈餅圖。有沒有一種方法可以將工具提示放在餅圖片之外?如何在餅圖外顯示高位圖工具提示?
http://jsfiddle.net/jlai403/6eenxom2/4/
$('#container').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
useHTML: true,
text: '<span style="text-align:center; top: -50px; position: relative"><h6>such pie much wow</h6><h2>79</h2></span>',
verticalAlign: 'middle',
},
tooltip: {
useHTML: true,
pointFormat: "<img src='{point.customValue}' width='50'/>"
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
useHTML: false,
enabled: false,
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
series: [{
type: 'pie',
name: 'Some Pie Chart',
data: [
{name: 'turtle eating strawberry', y: 25, customValue: 'http://www.tehcute.com/pics/201109/baby-turtle-eats-strawberry.jpg'},
{name: 'red panda', y: 25, customValue: 'http://www.greenvillezoo.com/assets/img/Adopt/RedPanda.png'},
{name: 'doge', y: 50, customValue: 'http://img2.wikia.nocookie.net/__cb20141105223610/r2d/images/7/73/Dogepic.png'}
],
size: '60%',
innerSize: '50%',
startAngle: 0,
endAngle: 260
}]
});
你是什麼意思,在餅皮外?你想要一個靜態的地方還是動態的? – 2015-02-10 10:34:30
請參閱['tooltip.positioner'](http://api.highcharts.com/highcharts#tooltip.positioner)選項。但工具提示需要在圖表的容器內。如果您想在容器外部獲取工具提示,請使用['point.events.mouseOver'](http://api.highcharts.com/highcharts#plotOptions.series.point.events.mouseOver)和['point.events .mouseOut'](http://api.highcharts.com/highcharts#plotOptions.series.point.events.mouseOut) - 使用該事件創建自己的工具提示。 – 2015-02-10 10:43:09
@RaeenHashemi我不希望它在一個靜態位置。我希望它是動態的,但不包括扇形。 – Joey 2015-02-10 16:02:33