Closed owenzhao closed 2 years ago
A Workaround I found was to recreate BarChartData each time.
private func appendBarChartData(_ log:DTLog, limit: Int) {
let xAxisLabel = DateFormatter.localizedString(from: log.startTime, dateStyle: .none, timeStyle: .medium)
let color = ColourStyle(colour: log.connected ? .green : .red)
let point = BarChartDataPoint(value: Double(log.delay), xAxisLabel: xAxisLabel, colour: color)
let style = BarStyle(barWidth: 1, cornerRadius: CornerRadius(topLeft: 5, topRight: 5, bottomLeft: 5, bottomRight: 5),
colourFrom: .barStyle, colour: color)
if barChartData == nil {
let points = (1...limit).map { _ in getEmptyBarChartDataPoint() }
barChartData = BarChartData(dataSets: BarDataSet(dataPoints: points),
barStyle: style)
}
if let barChartData = barChartData {
var points = barChartData.dataSets.dataPoints
points.removeFirst()
points.append(point)
self.barChartData = BarChartData(dataSets: BarDataSet(dataPoints: points),
barStyle: style)
}
}
v2.10.0 should fix this.
I forked this project and I thought for a period updated bar chart, my new animation was fitter.
When the app ran, the bar chart didn't show properly. The overlay and info box were correct. But the bar didn't draw.
https://user-images.githubusercontent.com/2182896/165194101-6a525950-dfe9-40ef-9dc6-cc7417bd7e0e.mov