mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: disabled bar chart widget if there is no data to visualize
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user