Javascript 工具提示内的(Highcharts)按钮可以';t触发器
工具提示中的按钮在单击时没有任何操作,甚至设置onclick事件。下面是一个例子Javascript 工具提示内的(Highcharts)按钮可以';t触发器,javascript,highcharts,Javascript,Highcharts,工具提示中的按钮在单击时没有任何操作,甚至设置onclick事件。下面是一个例子 工具提示:{ 是的, 格式化程序:函数(){ 返回“”+this.point.date +“$”+这个.y +"测试",; }, }, 函数testAlert(){ 警报(“测试”); }; 工具提示中的链接有点棘手-尤其是当您有许多点靠在一起时,因为在您可以将鼠标移到链接上之前,工具提示将移动到下一点 因此,最好为每个点添加“url”属性,然后为点本身定义单击函数,如下所示: plotOptions:
工具提示:{
是的,
格式化程序:函数(){
返回“”+this.point.date
+“$”+这个.y
+"测试",;
},
},
函数testAlert(){
警报(“测试”);
};
工具提示中的链接有点棘手-尤其是当您有许多点靠在一起时,因为在您可以将鼠标移到链接上之前,工具提示将移动到下一点
因此,最好为每个点添加“url”属性,然后为点本身定义单击函数,如下所示:
plotOptions: {
series: {
point: {
events: {
click: function () {
location.href = this.options.url;
}
}
}
}
将工具提示的指针事件属性更改为
'auto'
tooltip: {
// pointFormat: '<div>{point.date}<br\>{point.air}<br\>${point.y}</div><button>test</button>',
useHTML: true,
formatter: function() {
return '<div>'+this.point.date+'<br\>'+this.point.air+'<br\><span>$'+this.y+'</span><br\><a href="http://www.w3schools.com">testtesttest</a></div>';
},
style: {
pointerEvents: 'auto'
}
},
工具提示:{
//pointFormat:“{point.date}{point.air}${point.y}test”,
是的,
格式化程序:函数(){
返回“”+this.point.date+''+this.point.air+'$'+this.y+'';
},
风格:{
pointerEvents:“自动”
}
},
实例
谢谢。你帮助我更多地了解了海图。
tooltip: {
// pointFormat: '<div>{point.date}<br\>{point.air}<br\>${point.y}</div><button>test</button>',
useHTML: true,
formatter: function() {
return '<div>'+this.point.date+'<br\>'+this.point.air+'<br\><span>$'+this.y+'</span><br\><a href="http://www.w3schools.com">testtesttest</a></div>';
},
style: {
pointerEvents: 'auto'
}
},