简体   繁体   English

如何在高地图上显示悬停数据?

[英]How can show multiple data on hover with highmaps?

How can show multipe datas on hover on map with highmaps? 如何在具有高图的地图上的悬停上显示多倍数据?

http://www.highcharts.com/maps/demo http://www.highcharts.com/maps/demo

Normally we can show data like this: 通常我们可以显示如下数据:

 var data = [];
    $.each(columns[0], function (i, code) {
        data.push({
            code: code,
            value: columns[3][i],
            name: columns[2][i],
            hasta:columns[4][i]

        });
    });

But this allow only one type data with joinBy: 但这只允许使用joinBy使用一种类型的数据:

 series : [{
                    data : data,
                    mapData: Highcharts.maps['countries/tr/tr-all'],
                    joinBy: ['hc-key','name'],
                    animation: true,
                    name: 'Diyaliz Verileri',
                    states: {
                        hover: {
                            color: '#BADA55'
                        }
                    },
                    tooltip: {
                        valueSuffix: ''
                    }
                }]

But When we want to show multple datas on hover , What we can do? 但是,当我们想显示悬停时的大量数据时,我们能做什么?

jsfiddle: http://jsfiddle.net/CMengineer/j9mujnnz/ jsfiddle: http : //jsfiddle.net/CMengineer/j9mujnnz/

Works the same as a regular highcharts graph. 与常规highcharts图相同。 Just define a customer tooltip formatter : 只需定义一个客户工具提示格式化程序即可

             tooltip: {
                 formatter: function(){
                     var s = this.key + '<br/>';
                     s += 'Value:' + this.point.value + '<br/>';
                     s += 'Hasta:' + this.point.hasta;
                     return s;
                 },
             },

Updated fiddle . 更新小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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