在highslide应用中,对高亮显示框中的文字添加超链接或按钮的方法。
该例子是基于highcharts应用上的
http://www.w3.org/TR/html4/strict.dtd">
Highcharts Example
<!-- 1. Add these JavaScript. inclusions in the head of your page -->
<!--[if IE]>
<!-- 2. Add the JavaScript. to initialize the chart on document ready -->
var chart;
//globally available
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'spline'
},
title: {
text: 'Monthly Average Temperature in Tokyo'
},
subtitle: {
text: 'Source: WorldClimate.com'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
title: {
text: 'Month'
}
},
yAxis: {
title: {
text: 'Temperature (°C)'
}
},
legend: {
enabled: false
},
tooltip: {
formatter: function() {
return ''+ this.series.name +'
'+
this.x +': '+ this.y +'°C';
}
},
plotOptions: {
spline: {
cursor: 'pointer',
point: {
events: {
click: function() {
//alert("Hello Word!");
//window.open("line-basic.htm");
//window.navigate("line-basic.htm");
//window.location.href="line-basic.htm";
/*hs.expand(null, {
src: 'skies.jpg'
});
hs.Expander.prototype.onImageClick = function (sender) {
return window.open("line-basic.htm");
}*/
hs.htmlExpand(null, {
pageOrigin: {
x: this.pageX,
y: this.pageY
},
headingText: "\n \n"+this.series.name+"",
maincontentText: 'this.category: '+ this.category +
'
this.y: '+ this.y, width: 200
});
}
}
}
}
},
series: [{
name: 'Tokyo',
dataURL: 'tokyo.json'
}]
});
});
<!-- 3. Add the container -->
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10314474/viewspace-667505/
,如需转载,请注明出处,否则将追究法律责任。