set static height for homescreen graph

home screen graph start at zero
This commit is contained in:
Trey t
2022-01-22 16:27:55 -06:00
parent 7322151595
commit 8648a8f834
2 changed files with 10 additions and 9 deletions

View File

@@ -176,11 +176,11 @@ struct ContentView: View {
viewModel.add(mood: mood, forDate: date)
}
})
.frame(minHeight: 85, maxHeight: 180)
.frame(height: 180)
.frame(minWidth: 0, maxWidth: .infinity)
} else {
HeaderStatsView(fakeData: false, backDays: 30)
.frame(minHeight: 85, maxHeight: 180)
.frame(height: 180)
// should match backDays above
Text("Past \(30) days")
.font(.body)

View File

@@ -41,31 +41,32 @@ struct HeaderStatsView : UIViewRepresentable {
let chart = BarChartView()
chart.drawGridBackgroundEnabled = false
chart.drawValueAboveBarEnabled = false
chart.xAxis.drawAxisLineEnabled = false
chart.xAxis.labelTextColor = .clear
chart.rightAxis.drawAxisLineEnabled = false
chart.rightAxis.labelTextColor = .clear
chart.leftAxis.drawAxisLineEnabled = false
chart.leftAxis.labelTextColor = .clear
chart.xAxis.drawGridLinesEnabled = false
chart.leftAxis.drawGridLinesEnabled = false
chart.rightAxis.drawGridLinesEnabled = false
chart.leftAxis.axisLineColor = .clear
chart.rightAxis.axisLineColor = .clear
chart.legend.textColor = .clear
chart.legend.enabled = false
chart.drawBordersEnabled = false
chart.drawMarkers = false
chart.borderColor = .clear
chart.doubleTapToZoomEnabled = false
chart.leftAxis.axisMinimum = 0
let data = BarChartData()
let dataSet = dataSet()