Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 需要在HighChart中链接URL_Javascript_Php_Jquery_Highcharts - Fatal编程技术网

Javascript 需要在HighChart中链接URL

Javascript 需要在HighChart中链接URL,javascript,php,jquery,highcharts,Javascript,Php,Jquery,Highcharts,我正在使用HighChart插件绘制图形/条形图。单击饼图部分时,我想链接其他页面,或者换句话说,我想重定向到其他页面 演示链接: 它们没有传递部件的ID,因此我无法为饼图部件编写任何事件。添加 events:{ click: function (event) { alert(event.point.name); // add your redirect code and u can get data using e

我正在使用HighChart插件绘制图形/条形图。单击饼图部分时,我想链接其他页面,或者换句话说,我想重定向到其他页面

演示链接:

它们没有传递部件的ID,因此我无法为饼图部件编写任何事件。

添加

  events:{
      click: function (event) {
                 alert(event.point.name);
              // add your redirect code and u can get data using event.point
     }
 }
在plotOptions.pie中

像这样

 plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: true,
                color: '#000000',
                connectorColor: '#000000',
                format: '<b>{point.name}</b>: {point.percentage:.1f} %'
            },
            events:{
              click: function (event) {
                  alert(event.point.name);
                  // add your redirect code and u can get data using event.point
              }
          }
        }
    }

谢谢你,它奏效了。。
 plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: true,
                color: '#000000',
                connectorColor: '#000000',
                format: '<b>{point.name}</b>: {point.percentage:.1f} %'
            },
            events:{
              click: function (event) {
                  alert(event.point.name);
                  // add your redirect code and u can get data using event.point
              }
          }
        }
    }