svg.append('g').attr('class', 'chart').selectAll('.bar-group').data(Object.entries(data)).enter().append('g').attr('class','bar-group').attr('transform', (d, i) => {
if ( marcas.lenght % 2 != 0 ) {
return 'translate(' + (x0(d[0]) - calcularDesplazamiento(4, aumento, 4)) + ',0)'
}
return 'translate(' + (x0(d[0])- calcularDesplazamiento(4, aumento, 4)) + ',0)'}).selectAll('rect').data((d,i) => {return Object.entries(d[1]);})
.enter()
.append('rect')
.attr('class', 'bar')
.attr('x', (d,i) => {return (x0(d[0]))})
.attr('y', (d) => { return y(d[1])})
.attr('width', 5)
.attr('height', (d) => { return height - y(d[1])}).attr('fill', (d,i) => { return colorScheme[i]}).attr('rx', 4).attr('ry', 4)
.attr('transform', (d, i) => {
return 'translate(' + ((x0.bandwidth() / 2 + (aumento * i))) + ', 0)'})