我有高光標與標誌圖表。一切都很好,但我想改變旗幟的工具提示的位置。 (將標誌的工具提示移動到標誌的上方)。同時我也想給鏈接標誌文字「測試測試」,它將在新標籤中打開。誰能幫我?這是我完整的代碼http://jsfiddle.net/anant_ghate/8byc9/1/移動標誌工具提示到上側
// Create the chart
window.chart = new Highcharts.StockChart({
chart: {
renderTo: 'container'
},
tooltip: {
positioner: function(boxWidth, boxHeight, point) {
return {
x: point.plotX + 20,
y: point.plotY + -20
};
},
shared:true,
formatter: function(){
var p = '';
if(this.point) {
p += '<span>'+ Highcharts.dateFormat('%A, %b %e, %Y', this.point.x) +'</span><br/>';
p += '<b>'+ this.point.title + '</b>' // This will add the text on the flags
}
else {
p += '<b>'+ Highcharts.dateFormat('%A, %b %e, %Y', this.x) +'</b><br/>';
$.each(this.points, function(i, series){
p += '<span style="color:' + this.series.color + '">' + this.series.name + '</span>: <b>'+ this.y;
});
}
return p;
},
},
rangeSelector: {
selected: 1
},
title: {
text: 'USD to EUR exchange rate'
},
yAxis: {
title: {
text: 'Exchange rate'
}
},
series: [{
name: 'USD to EUR',
data: data,
id: 'dataseries',
tooltip: {
yDecimals: 4
}
}, {
type: 'flags',
data: [{
x: Date.UTC(2011, 1, 20),
title: 'Test test'
}, {
x: Date.UTC(2011, 3, 20),
title: 'Test test'
}],
onSeries: 'dataseries',
allowPointSelect : true,
shape: 'squarepin',
y : -40
}]
});