Highmaps 向下钻取地图选择事件

问题描述 投票:0回答:2

我设法使用“Highmaps”(http://www.highcharts.com/maps/demo)与县创建了挪威地图,当它选择一个县时,它会深入到市镇。我需要在深入分析中捕获

select
事件并根据市政府显示一些数据。但找不到任何可供深入分析的事件。

有什么想法吗?

javascript highcharts dom-events
2个回答
0
投票

我在 Highcharts 服务台支持的帮助下解决了这个问题。 这是小提琴http://jsfiddle.net/bydfsxe2/

// Set drilldown pointers
$.each(data, function (i) {
    this.drilldown = this.properties['hc-key'];
    this.value = i; // Non-random bogus data
});

// Instanciate the map
Highcharts.mapChart('container', {
    chart: {
        events: {
            drilldown: function (e) {
//call external function
                                    alert(e.point.drilldown);
//rest of the code

0
投票

但是如果我们使用 useState 来设置这个值,而不是alert(e.point.drilldown),我们必须单击两次才能加载钻取地图,任何人都可以帮助我。如果我使用 setPointValue(e.point.drilldown) ,则需要单击两次才能显示它的钻取地图,我如何通过单击获得它以及更新的 e.point.drilldown 值以供进一步使用....

© www.soinside.com 2019 - 2024. All rights reserved.