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 {
|
if let moodEntries = moodEntries {
|
||||||
for (index, mood) in Mood.allValues.enumerated() {
|
for (index, mood) in Mood.allValues.enumerated() {
|
||||||
entries.append(BarChartDataEntry(x: Double(index + 1),
|
entries.append(
|
||||||
y: Double(moodEntries.filter({
|
BarChartDataEntry(x: Double(index + 1),
|
||||||
Int($0.moodValue) == mood.rawValue
|
y: Double(moodEntries.filter({
|
||||||
}).count)))
|
Int($0.moodValue) == mood.rawValue
|
||||||
|
}).count))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,6 +70,8 @@ struct HeaderStatsView : UIViewRepresentable {
|
|||||||
chart.doubleTapToZoomEnabled = false
|
chart.doubleTapToZoomEnabled = false
|
||||||
chart.leftAxis.axisMinimum = 0
|
chart.leftAxis.axisMinimum = 0
|
||||||
|
|
||||||
|
chart.minOffset = 0
|
||||||
|
|
||||||
let data = BarChartData()
|
let data = BarChartData()
|
||||||
let dataSet = dataSet()
|
let dataSet = dataSet()
|
||||||
data.append(dataSet)
|
data.append(dataSet)
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ struct SwitchableView: View {
|
|||||||
ZStack {
|
ZStack {
|
||||||
HeaderStatsView(fakeData: false, backDays: daysBack)
|
HeaderStatsView(fakeData: false, backDays: daysBack)
|
||||||
.opacity(currentViewIdx == 0 ? 1 : 0)
|
.opacity(currentViewIdx == 0 ? 1 : 0)
|
||||||
|
.padding([.leading, .trailing], -20)
|
||||||
|
.padding([.top, .bottom], 8)
|
||||||
.allowsHitTesting(false)
|
.allowsHitTesting(false)
|
||||||
|
|
||||||
HeaderPercView(fakeData: false, backDays: daysBack, type: .circular)
|
HeaderPercView(fakeData: false, backDays: daysBack, type: .circular)
|
||||||
|
|||||||
Reference in New Issue
Block a user