简体   繁体   English

如何绘制带有缩放选项的D3条形图

[英]How to Draw D3 Bar chart With Zooming Option

i am using D3 bar chart, for this chart the data is in large amount, i want to see that data by zooming this chart or else it will be good if i will get that scrolling option on x axis...... but i don't know how to make it. 我正在使用D3条形图,此图表的数据量很大,我想通过缩放此图表来查看该数据,否则,如果我在x轴上获得该滚动选项,那将是很好的......但是我不知道该怎么做。 I am New to this environment please help me to find the answer for this question Thanks in advance 我是这种环境的新手,请帮助我找到该问题的答案

You can use the zoom event of d3: 您可以使用d3的zoom事件:

d3.behavior.zoom()

This is the explanation from d3 documentation: 这是d3文档中的解释:

https://github.com/mbostock/d3/wiki/Zoom-Behavior https://github.com/mbostock/d3/wiki/Zoom-Behavior

And there are other good examples with code, like: 还有其他一些很好的代码示例,例如:

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

http://bl.ocks.org/godds/ec089a2cf3e06a2cd5fc http://bl.ocks.org/godds/ec089a2cf3e06a2cd5fc

http://bl.ocks.org/stepheneb/1182434 http://bl.ocks.org/stepheneb/1182434

http://jsfiddle.net/qkHK6/912/ http://jsfiddle.net/qkHK6/912/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM