                     barRect.origin.y = top
                     barRect.size.height = bottom - top
 
-                    buffer.rects[bufferIndex] = barRect
+                    _buffers[index][bufferIndex] = barRect
                     bufferIndex += 1
                 }
             }

                for index in 0 ..< Int(ceil(Double(dataSet.count) * animator.phaseX)) {
                    guard let e = dataSet[index] as? BarChartDataEntry else { continue }

                    let rect = buffer.rects[bufferIndex]

                    let vals = e.yValues


            for i in barData.indices {
                let set = barData[i] as! BarChartDataSet
                let size = set.count * (set.isStacked ? set.stackSize : 1)
                if _buffers[i].count != size {
                    _buffers[i] = [CGRect](repeating: CGRect(), count: size)
                }
            }
        } else {
