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

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

问题描述

我想做这种地理定位的3d条形图

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

d3.js can deal with 3d map projections

有没有办法在给定的坐标上投影一个条形以获得类似于 kartograph 的结果?

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

推荐答案

D3 中的任何投影数据都可以在其上放置条形,矩形的 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天全站免登陆