function chart_bar(ci_input, title, imgs){
const svg = d3.create("svg").attr("width", width).attr("height", height).attr("stroke-width", 3);
var xScaler = xScale
var yScaler = yScale
svg.append("rect")
.attr('x', 0)
.attr('y', 0)
.attr('height', height)
.attr('width', width)
.attr("fill", "white")
const xAxis = svg
.append("g")
.attr("transform", `translate(0, ${yScaler(0)})`)
.attr("stroke-width", 2)
.call(d3.axisBottom(xScaler));
var y_thick = 1.5
var start_stack = height - margin.bottom - 30
var space = 70
var rect_thick = 3
for(var i = 0; i < ci_input.length; i++){
svg.append("rect")
.attr("x", margin.left)
.attr("y", start_stack - 35 - space*i)
.attr("height", 65)
.attr("width", width - margin.left-margin.right)
.attr("fill", "#F5F5F5")
svg.append("circle")
.attr("cx", xScaler(ci_input[i].mean))
.attr("cy", start_stack - rect_thick - space*i)
.attr("r", 7)
.attr("fill", color[ci_input[i].chart])
svg.append("rect")
.attr("x", xScaler(ci_input[i].low68))
.attr("y", start_stack - rect_thick*2 - space*i)
.attr("height", rect_thick*2)
.attr("width", xScaler(ci_input[i].high68) - xScaler(ci_input[i].low68))
.attr("fill", color[ci_input[i].chart])
svg.append("rect")
.attr("x", xScaler(ci_input[i].low95))
.attr("y", start_stack - rect_thick*1.5 - space*i)
.attr("height", rect_thick)
.attr("width", xScaler(ci_input[i].high95) - xScaler(ci_input[i].low95))
.attr("fill", color[ci_input[i].chart])
svg.append("text")
.attr("x", xScaler(ci_input[i].mean))
.attr("y", start_stack - rect_thick*1.5 - space*i - 8)
.text(ci_input[i].chart)
.attr("text-anchor", "middle")
.attr("fill", "dark-gray")
.attr("font-family", "sans-serif")
.attr("font-size", "0.75em")
.attr("font-style", "italic")
svg.append("img")
.attr("y", start_stack - rect_thick/2 - space*i-30)
.attr("x", margin.left*2)
.attr("height",55)
.attr("xlink:href", imgs["img_"+ci_input[i].chart])
}
svg.append("text")
.attr("x", width/2)
.attr("y", height - margin.bottom/3)
.text(title)
.attr("text-anchor", "middle")
.attr("fill", "dark-gray")
.attr("font-family", "sans-serif")
.attr("font-size", "1em")
return svg.node();
}