on main view top graph take away leading and trailing padding
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user