Highcharts Column chart pie chart plus URL or click event

Source: Internet
Author: User

when we make a chart, we sometimes need to add links or click events to individual data, which is set in events in Plotoptions.
Plotoptions: {    pie: {        cursor: ' pointer ',        events: {            click:function (e) {location.href = E.point.url;// Above is the current page jump, if you want to jump out of the new page, then use                //window.open (e.point.url);                Here the URL is given in the following data in the    }},    }},series: [{    data: [        {Name: ' Property Group ', Y:76,url: ' http://www.baidu.com '},        {name: ' energy group ', Y:54,url: ' http://www.google.com '},             {        {name: ' Internet ', Y:20,url: ' Http://www.sohu.com '}}]

  

The above is for the pie chart, if it is a column chart then replace pie:{} with column: {}

Of course, if you switch to series:{, then you don't have to be a pie chart or a bar chart or any other graphic.

Plotoptions: {    series: {        cursor: ' pointer ',        events: {            click:function (e) {location.href = E.point.url;                //above is the current page jump, if you want to jump out of the new page, then use                //window.open (e.point.url);                Here the URL is given in the following data in the    }},    }},series: [{    data: [        {Name: ' Property Group ', Y:76,url: ' http://www.baidu.com '},        {name: ' energy group ', Y:54,url: ' http://www.google.com '},             {        {name: ' Internet ', Y:20,url: ' Http://www.sohu.com '}}]

  

Highcharts Column chart pie chart plus URL or click event

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.