Highcharts密度点图支持? [英] Highcharts Density Dot Map Support?

查看:200
本文介绍了Highcharts密度点图支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的工作中,我的老板正在要求我实施点密度图。现在我无法了解细节,但我已经实现了一个简单的纬度/经度图,如下图所示:

http://jsfiddle.net/ gh / get / jquery / 1.9.1 / highslide-software / highcharts.com / tree / master / samples / maps / demo / mappoint-latlon /

我正在使用佛罗里达州,因为这是我感兴趣的地方。无论如何,我正试图创建一个点密度映射,其中每个点都与一个值相关联。该值将与简单颜色相关联,其中值越大颜色越深,值越低颜色越浅。颜色可以是任意的,我只是找不到一个足够简单的例子,甚至没有例子。我不知道这是否支持,我可以创建一个choropleth。



问题是,即使我有颜色轴设置和JSON格式正确的例如:

  {
name:'poi'
value:value,
lat:lat-值,
lon:长值
}

我仍然不能得到一个点密度图。我所得到的只是JSFiddle的例子,佛罗里达州地图及其上的要点。我也得到了颜色轴,但点没有不同的颜色。有人可以提供一些帮助,它可以从信息范围到一个简单的它不能在没有定制它的情况下在highmaps中支持。

解决方案

mappoint 系列不适用于 colorAxis ,但是,它是Highcharts,因此可以扩展默认功能:

 (function H){
// add colorAxis
H.seriesTypes.mappoint.prototype.axisTypes = ['xAxis','yAxis','colorAxis'];

//绘制点并添加设置颜色
H.wrap(H.seriesTypes.mappoint.prototype,translate,function(p){
p.call(this);
H.seriesTypes.mappoint .prototype.translateColors.call(this);
});

//从热图复制颜色混合的方法
H.seriesTypes.mappoint.prototype.translateColors = H. seriesTypes.heatmap.prototype.translateColors;

//使用value计算颜色
H.seriesTypes.mappoint.prototype.colorKey ='value';
})( Highcharts);

工作演示: http://jsfiddle.net/4mabw6zr/


At my work my boss is asking me to implement a dot density map . Now I can't get into the details but I have implemented a simple lat/lon map as shown in this link:

http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/maps/demo/mappoint-latlon/

I am using the state of Florida because that is the point of interest for me. Anyway I am trying to create a dot density map where each point is associated with a value. That value would be associated with a simple color where the greater the value the darker the color and the lower the value the lighter the color. The colors can be arbitrary, I just can't find a simple enough example or even example for that matter. I don't know if this supports that, I can create a choropleth.

The problem that even though I have the color axis setup and the JSON format correct for example:

{
                name : 'poi'
                value: value,
                lat: lat-value,
                lon: long-value
}

I still can't get a dot density map. All I get is the working JSFiddle example, with the Florida map and the points on it. I also get the color axis but the points don't have different colors. Can somebody provide some assistance, it could range from information to a simple "It can't be supported in highmaps without customizing it".

解决方案

mappoint series doesn't work with colorAxis, but well, it's Highcharts so it's possible to extend default functionalities:

(function (H) {
    // add colorAxis
    H.seriesTypes.mappoint.prototype.axisTypes = ['xAxis', 'yAxis', 'colorAxis']; 

    // draw points and add setting colors
    H.wrap(H.seriesTypes.mappoint.prototype, "translate", function (p) {
        p.call(this);
        H.seriesTypes.mappoint.prototype.translateColors.call(this);
    });

    // copy method from heatmap for color mixin
    H.seriesTypes.mappoint.prototype.translateColors = H.seriesTypes.heatmap.prototype.translateColors; 

    // use "value" to calculate color
    H.seriesTypes.mappoint.prototype.colorKey = 'value';
})(Highcharts);

And working demo: http://jsfiddle.net/4mabw6zr/

这篇关于Highcharts密度点图支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆