我有一个highcharts,根据我的数据库中的数据呈现数据.我正在使用'bar'类型.现在我希望当用户点击栏时它会重定向到特定页面或者例如另一个网站.我用Google搜索但无法得到答案.这是我正在使用的代码.
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Population (millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
formatter: function() {
return ''+
this.series.name +': '+ this.y +' millions';
} …Run Code Online (Sandbox Code Playgroud)