jquery - 销售管道图

标签 jquery d3.js

我正在尝试使用 d3 创建销售管道图。下面是一个例子。有谁知道我可以开始使用的示例代码吗?

http://i.imgur.com/FKoHk.png

感谢任何帮助。

最佳答案

对于不同的方法,这里是一个完全使用 CSS 的示例:

<div id='chart'>
  <div id='plotA'>&nbsp;</div>
  <div id='plotB'>&nbsp;</div>
  <div id='plotC'>&nbsp;</div>
  <div id='plotD'>&nbsp;</div>
  <div id='plotE'>&nbsp;</div>
</div>

#chart {
  text-align: center;
}
#chart div {
  margin-top: 2px;
}
#plotA {
  border-top: 5px solid #3B5592;
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  height: 0; width: 200px;
}
#plotB {
  border-top: 100px solid #BF2E2B;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  height: 0; width: 100px;
}
#plotC {
  margin-left: 50px;
  border-top: 50px solid #8CB638;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  height: 0; width: 50px;
}
#plotD {
  margin-left: 74px;
  border-top: 23px solid #684A94;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  height: 0; width: 18px;
}
#plotE {
  margin-left: 90px;
  border-top: 15px solid #24A4C7;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  height: 0; width: 4px;
}

with a demo

关于jquery - 销售管道图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12643824/

相关文章:

javascript - 从解析的 CSV 数组中删除重复项

javascript - 当我在 jQuery 中执行 AJAX 调用时出现 JSON 错误

javascript - 将 jQuery.ajax 定义为方法

javascript - d3 版本 4 rescaleX 其中 X 比例是scaleTime

javascript - d3 treemap 根据 json 中传递的数据改变颜色

javascript - D3.js:缩放 svg 时错过刻度线

javascript - 滚动到底部不触发行为

javascript - 对多个子项使用每个函数

javascript, jQuery - 检查数组中是否存在值

javascript - 无法读取事件监听器中 null 的属性 'sourceEvent'