From 9c9ea7ecccb4372fc40ae180de79848499ca67df Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 5 Nov 2021 19:12:05 +0100 Subject: [PATCH] feat: adjusted line chart width --- Kit/Widgets/LineChart.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kit/Widgets/LineChart.swift b/Kit/Widgets/LineChart.swift index 12de29d8..3ff48e64 100644 --- a/Kit/Widgets/LineChart.swift +++ b/Kit/Widgets/LineChart.swift @@ -19,12 +19,12 @@ public class LineChart: WidgetWrapper { private var valueColorState: Bool = false private var colorState: Color = .systemAccent - private let width: CGFloat = 30 + private let width: CGFloat = 32 private var chart: LineChartView = LineChartView(frame: NSRect( x: 0, y: 0, - width: 30, + width: 32, height: Constants.Widget.height - (2*Constants.Widget.margin.y) ), num: 60) private var colors: [Color] = Color.allCases @@ -159,7 +159,7 @@ public class LineChart: WidgetWrapper { NSAttributedString.Key.paragraphStyle: style ] - let rect = CGRect(x: x+4, y: boxSize.height-7, width: boxSize.width-1, height: 7) + let rect = CGRect(x: x+4, y: boxSize.height-7, width: boxSize.width-4, height: 7) let str = NSAttributedString.init(string: "\(Int((value.rounded(toPlaces: 2)) * 100))%", attributes: stringAttributes) str.draw(with: rect)