使用D3的量规图 [英] Gauge chart using D3

查看:138
本文介绍了使用D3的量规图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用d3建立一个量规,而我还是设法破解了一些满足视觉要求的东西 http://bl.ocks.org/ameyms/9140907

I've been trying to build a gauge using d3 and ive managed to hack up something that meets the visual requirements http://bl.ocks.org/ameyms/9140907

但是,这是一个非常棘手的解决方案,因为ive通过反复试验将针定位,如果为高度和宽度指定百分比值,整个过程都会中断. 那我该怎么定位呢?

This is however a very very hacky solution since ive positioned the needle by trial and error and the whole thing breaks if height and width are assigned percentage values. So how do I position it?

还有,我该如何使针头旋转?

Also, how I can make the needle rotate?

有什么想法吗?

推荐答案

对于任何来这里寻求答案的人,我已经使用D3创建了一个量规演示

For anyone coming here looking for answers, I have created a demo of gauge using D3 here

这篇关于使用D3的量规图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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