Chart title positioning bug


I have a line chart inside a UITableViewCell. The chart gets reused with the cells as I scroll through the table view. This results in a very weird positioning of the chart title label after couple of redraws, as demonstrated on the following screenshots: - this is the correct position at the beginning

I set the chart.title in sChart:dataPointsForSeriesAtIndex:. As a side-note, I tried doing it in tableView:cellForRowAtIndexPath: and the result is even worse. Besides this I don’t do anything to chart.title or chart.titleLabel.

Any idea what’s going on and how to fix it?


Problem solved. I was adding the chart as a subview multiple times in layoutSubviews.