如何用d3.js在世界地图上绘制一个3d条形图? [英] How to draw a 3d bar chart on a world map with d3.js?

查看:336
本文介绍了如何用d3.js在世界地图上绘制一个3d条形图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这种定位的3D条形图

d3.js可以处理 3d地图投影

d3.js can deal with 3d map projections

有没有办法在给定的坐标上投射一个bar来获得类似于kartograph的结果?

Is there a way to project a bar on a given coordinate to get a result similar to kartograph ?

推荐答案

D3中的任何投影数据都可以在其上放置条,其中rect的xy是在一个延长点。以下是D3的卫星投影示例:

Any projected data in D3 can have bars placed on them with the xy of the rect being at a latlong point. Here's an example with D3's satellite projection:

http:// bl.ocks.org/4531633

要匹配Kartograph示例的样式,您需要旋转相对于点与它相关联,以及使用不透明度。

To match the style of the Kartograph example, you'd need to rotate the rect in relation to the projection of the point it's associated with, as well as playing with opacity.

这篇关于如何用d3.js在世界地图上绘制一个3d条形图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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