Skip to content

Commit

Permalink
Fix compile issues with Charts v4
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJKM committed Sep 30, 2022
1 parent 95238d1 commit b2760a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions MensaGuthaben/Views/Helpers/ChartsContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// MensaGuthaben
//
// Created by Johannes Kreutz on 24.09.19.
// Copyright © 2019 - 2020 Johannes Kreutz. All rights reserved.
// Copyright © 2019 - 2022 Johannes Kreutz. All rights reserved.
//
// This file is part of MensaGuthaben.
//
Expand Down Expand Up @@ -61,8 +61,7 @@ struct ChartsContainer: UIViewRepresentable {
}
// Create and configure chart data set
let dataSet: LineChartDataSet = LineChartDataSet(entries: entry, label: "balance history")
let data: LineChartData = LineChartData()
data.addDataSet(dataSet)
let data: LineChartData = LineChartData(dataSet: dataSet)
data.setDrawValues(true)
dataSet.colors = [UIColor.systemBlue]
dataSet.setCircleColor(UIColor.systemBlue)
Expand All @@ -73,7 +72,7 @@ struct ChartsContainer: UIViewRepresentable {
guard let gradient = CGGradient.init(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: gradientColors, locations: [1.0, 0.0]) else {
return
}
dataSet.fill = Fill.fillWithLinearGradient(gradient, angle: 90.0)
dataSet.fill = LinearGradientFill(gradient: gradient, angle: 90.0)
dataSet.drawFilledEnabled = true
dataSet.label = "Test"
// Setup formatter
Expand All @@ -88,7 +87,7 @@ struct ChartsContainer: UIViewRepresentable {

}

class ChartFormatter: NSObject, IValueFormatter {
class ChartFormatter: ValueFormatter {

func stringForValue(_ value: Double, entry: ChartDataEntry, dataSetIndex: Int, viewPortHandler: ViewPortHandler?) -> String {
return String(format: "%.2f", value).replacingOccurrences(of: ".", with: ",")
Expand Down
4 changes: 2 additions & 2 deletions MensaGuthaben/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// MensaGuthaben
//
// Created by Johannes Kreutz on 24.08.19.
// Copyright © 2019 - 2021 Johannes Kreutz. All rights reserved.
// Copyright © 2019 - 2022 Johannes Kreutz. All rights reserved.
//
// This file is part of MensaGuthaben.
//
Expand Down Expand Up @@ -84,7 +84,7 @@ struct SettingsView: View {
//NavigationLink("settings.addmy", destination: AddCanteenView())
}
Section(header: Text("settings.about")) {
TextRow(title: "© 2019 - 2021 Johannes Kreutz.\nAlle Rechte vorbehalten.\nVersion \(appVersion) Build \(getBuildString())\n(compiled \(getCompileTimeString()))")
TextRow(title: "© 2019 - 2022 Johannes Kreutz.\nAlle Rechte vorbehalten.\nVersion \(appVersion) Build \(getBuildString())\n(compiled \(getCompileTimeString()))")
NavigationLink("settings.legal", destination: LegalView())
}
Section(header: Text("OPEN SOURCE"), footer: Text("Made with ❤ and some code on the 🚂 between Marburg and Darmstadt.")
Expand Down

0 comments on commit b2760a2

Please sign in to comment.