on main view top graph take away leading and trailing padding

This commit is contained in:
Trey t
2022-02-06 15:37:35 -06:00
parent 4ff9d7ad91
commit 25717e52ae
2 changed files with 10 additions and 4 deletions

View File

@@ -27,10 +27,12 @@ struct HeaderStatsView : UIViewRepresentable {
}
if let moodEntries = moodEntries {
for (index, mood) in Mood.allValues.enumerated() {
entries.append(BarChartDataEntry(x: Double(index + 1),
y: Double(moodEntries.filter({
Int($0.moodValue) == mood.rawValue
}).count)))
entries.append(
BarChartDataEntry(x: Double(index + 1),
y: Double(moodEntries.filter({
Int($0.moodValue) == mood.rawValue
}).count))
)
}
}
}
@@ -68,6 +70,8 @@ struct HeaderStatsView : UIViewRepresentable {
chart.doubleTapToZoomEnabled = false
chart.leftAxis.axisMinimum = 0
chart.minOffset = 0
let data = BarChartData()
let dataSet = dataSet()
data.append(dataSet)

View File

@@ -19,6 +19,8 @@ struct SwitchableView: View {
ZStack {
HeaderStatsView(fakeData: false, backDays: daysBack)
.opacity(currentViewIdx == 0 ? 1 : 0)
.padding([.leading, .trailing], -20)
.padding([.top, .bottom], 8)
.allowsHitTesting(false)
HeaderPercView(fakeData: false, backDays: daysBack, type: .circular)