链接两个D3图 [英] Link two D3 plots

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

问题描述

我试图链接两个D3绘图,以便选择右侧直方图的一部分,使一个特定的散点图显示在左侧。



是我的尝试。



我当前的问题是为什么正确的图不渲染,我想回到如何创建和引用多个SVG标签在d3。 / p>

解决方案

D3有这种类型的情况的SVG控件。



这是API文档:

=https://github.com/mbostock/d3/wiki/SVG-Controls =nofollow> https://github.com/mbostock/d3/wiki/SVG-Controls



这里有两个很棒的例子:



http://bl.ocks.org/mbostock/4063663



http://bl.ocks.org/mbostock/1667367


I'm trying to link two D3 plots so that selecting part of the histogram on the right, causes a certain scatter plot to display on the left.

This is my attempt.

My current question is why the right plot isn't rendering, which I think goes back to how to create and refer to multiple SVG tags in d3.

解决方案

D3 has SVG controls for this type of situation. What you are looking for is a brush with context.

Here are the API docs:

https://github.com/mbostock/d3/wiki/SVG-Controls

And here are two great examples:

http://bl.ocks.org/mbostock/4063663

http://bl.ocks.org/mbostock/1667367

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

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