d3 based multiple sub groups of a bar chart

孤街浪徒 提交于 2021-02-10 06:10:24

问题


I am trying to produce a bar graph that has multiple hierarchical / groupings of factors using d3.js. An example from excel of what I am attempting to create, subgrouped by Variety and Irrigation treatment:

enter image description here

I have searched for quite some time and have yet to see an example of something like the example graph above. The closet I found is this (as well as this, this, and this).

but they all lack the one more level of grouping that I need.

Is there a way to create multiple groupings in d3.js, or any other reusable charts based on d3.js, like dc.js?
If so, a demo chart is appreciated. You can use this csv data.
Chart Population1, Population2 etc for each countries, and group them by Continent.

UPDATE:

@Gordon, thanks for your reply and links. One thing though, are you sure the pull request is about multiple sub groups? From the posted pictures in the thread, it looks like just normal grouping to me:

which is already available in d3, e.g.,

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

Thanks for any help you may have!

来源:https://stackoverflow.com/questions/41575062/d3-based-multiple-sub-groups-of-a-bar-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!