简体   繁体   English

D3水平条形图的精确副本

[英]D3 Horizontal Bar Chart exact copy

Just started working with d3 and need to make a horizontal bar chart exactly like the one in the image for a project. 刚开始使用d3,需要制作水平条形图,就像项目图片中的图一样。 Any help would be appreciated. 任何帮助,将不胜感激。 Thanks. 谢谢。

Image of bar chart 条形图的图像

So far I have been working through this example and trying to adapt it to look like what I need. 到目前为止,我一直在研究示例,并尝试对其进行调整以使其看起来像我所需要的。

This will get you started.... 这将使您入门。

You can replace the data with some json or something 您可以将数据替换为json或其他内容

data = [
    {label:"new", value:10},
    {label:"repeat", value:55},
    {label:"loyal", value:35},
];

http://plnkr.co/edit/uzRkw1bNZfQDFfQsOh4t?p=preview http://plnkr.co/edit/uzRkw1bNZfQDFfQsOh4t?p=preview

Please find the below link to start the horizontal bar chart. 请找到以下链接以启动水平条形图。 it's in d3.v4 version. 它是d3.v4版本。

  • change the graph margin to reduce the size of svg 更改图形边距以减小svg的大小

HorizontalBarChart 水平条形图

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

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