简体   繁体   中英

How can I load a custom popup on a click event in Highcharts?

I have a highcharts bar chart and when I click on it I want to load a custom popup screen. This is my HTML page and I use angular-data-table for it.

<table datatable="ng" class="row-border hover">
<thead>
    <tr>
        <th>ID</th>
        <th>Description</th>
        <th>Datasource</th>
    </tr>
</thead>
<tbody ng-controller="DashBoardcontroller">
    <tr ng-repeat="w in dashboard.Widgets">
        <td>{{w.Id}}</td>
        <td>{{w.description}}</td>
        <td>{{w.datasource}}</td>
    </tr>
</tbody>

When I click on the bar chart I want this template to show up. I saw in the documentation of high charts this:

It shows a standard Alert popup. I use the chart from the documentation to test it:

Highcharts.chart('container', {
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    plotOptions: {
        series: {
            cursor: 'pointer',
            events: {
                click: function (event) {
                    alert(
                        this.name + ' clicked\n' +
                        'Alt: ' + event.altKey + '\n' +
                        'Control: ' + event.ctrlKey + '\n' +
                        'Meta: ' + event.metaKey + '\n' +
                        'Shift: ' + event.shiftKey
                    );
                }
            }
        }
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
});

How can I load my HTML template as a popup?

Kind regards

window.open("popupAddress?id=" + event.anyParameter);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM