function draw_combination_chart(div){
const container = div.append('div')
.style('display','flex')
.style('flex-direction', 'column')
const title = container.append('div')
.append('p')
.text('离职人数统计')
.style('margin', '0 0 0 0')
.style('padding', '18px 16px')
.style('font-family', 'sans-serif')
.style('font-size', '14px')
.style('font-weight', 500)
.style('color', '#1F2329')
const svg = container.append('div')
.style('display','flex')
.style('flex-direction', 'column')
.append('svg')
.attr('width', layout.svgWidth)
.attr('height', layout.svgHeight)
const g = svg.append('g').attr('class','svg-g').attr('transform', `translate(${layout.margin.left}, ${layout.margin.top})`)
g.append('g')
.attr('class', 'x-axis-g')
.attr('transform', `translate(0, ${layout.innerHeight})`)
.call(xAxis)
g.append('g')
.attr('class', 'y-axis-left-g')
.call(yAxisLeft)
.call(g=>{
g.selectAll('.tick line').clone()
.attr("x2", layout.innerWidth)
.attr("stroke-opacity", 0.1)
})
g.append('g')
.attr('class', 'y-axis-left-g')
.attr('transform', `translate( ${layout.innerWidth}, 0)`)
.call(yAxisRight)
const bars_g = g.append('g')
if(chartAttrs.barType == 'Grouped'){
bars_g.attr('class', 'grouped-bars-g')
.selectAll('g')
.data(stacked_data)
.join('g')
.attr('class', 'grouped-g')
.attr('transform', ([name, array])=>{
return `translate(${xScaleBand(name)},0)`
})
.selectAll('rect')
.data(d=>d[1])
.join('rect')
.attr('x', ({key})=>{
return innerXScaleBand(key)
})
.attr('y', ({value})=>yScale_Bars(value))
.attr('width', innerXScaleBand.bandwidth())
.attr('height', ({value})=>layout.innerHeight - yScale_Bars(value))
.attr('fill', ({key})=>colorScale_Bars(key))
}else if(chartAttrs.barType == 'Stacked'){
bars_g.attr('class', 'stacked-bars-g')
.selectAll('g')
.data(stack(stacked_data))
.join('g')
.attr('class', 'stack-layer-g')
.attr('fill', d=>{
return colorScale_Bars(d['key'])
})
.selectAll('rect')
.data(d=>d)
.join('rect')
.attr('x', d=>{
return xScaleBand(d['data'][0])
})
.attr('y', ([y1,y2])=> yScale_Bars(y2))
.attr('width', d=>xScaleBand.bandwidth())
.attr('height', ([y1,y2])=> yScale_Bars(y1)-yScale_Bars(y2))
}
let lines_g = g.append('g').attr('class', 'lines-g')
.selectAll('path')
.data(data)
.join('path')
.attr("fill", "none")
.attr('stroke-width', chartAttrs.line_width)
.attr('stroke-linejoin', 'round')
.attr('stroke-linecap', 'round')
.attr("stroke", d=>{
return colorScale_Lines(d[0])
})
.attr('d', d=>line(d[1]))
container.call(draw_legend)
}