feat: disabled bar chart widget if there is no data to visualize

This commit is contained in:
Serhiy Mytrovtsiy
2024-08-22 17:45:18 +02:00
parent 6fd89fe54c
commit bdbaeb8c4d

View File

@@ -101,6 +101,11 @@ public class BarChart: WidgetWrapper {
colorZones = self._colorZones
}
guard !value.isEmpty else {
self.setWidth(0)
return
}
var width: CGFloat = Constants.Widget.margin.x*2
var x: CGFloat = 0
let lineWidth = 1 / (NSScreen.main?.backingScaleFactor ?? 1)