-
Notifications
You must be signed in to change notification settings - Fork 1
/
bars.js
25 lines (25 loc) · 802 Bytes
/
bars.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export const bars = (cls,marginCh,scale,rectL,rectB) => {
var indRect = d3.select(`#${cls}`)
.append('g')
.attr('transform',`translate(${marginCh.left},${marginCh.top})`)
indRect.append('rect')
.attr('x',scale('one'))
.attr('width',scale.bandwidth())
.attr('height',rectL)
.attr('fill',"orange")
indRect.append('rect')
.attr('x',scale('two'))
.attr('width',scale.bandwidth())
.attr('height',rectL)
.attr('fill',"yellow")
indRect.append('rect')
.attr('x',scale('three'))
.attr('width',scale.bandwidth())
.attr('height',rectL)
.attr('fill',"blue")
indRect.append('rect')
.attr('x',scale('four'))
.attr('width',scale.bandwidth())
.attr('height',rectL)
.attr('fill',"black")
}