[quote='795150022, AppleCare Staff, /thread/759244?answerId=795150022#795150022'] So just a few lines of code would be enough, I think it should fit in 20 lines or less. For data, you can inline an array of tuples as I described. No need for preview, extensions, structs etc. just a single Chart. [/quote] Apologies, I thought perhaps an example with a Preview would be beneficial for demonstration purposes. I'm happy to reduce the amount of code a bit. No more extra structs, previews or extensions! However, I can't really get it down to 20 lines if I am to simulate my issue. I need a month of measurements and I'm not sure I can even create the array of ~30 items (with plenty of Calendar.current operations) in 20 lines of code. I hope about 40 lines of code is okay! let cal: Calendar = .current struct ChartWithNilValues2: View { let start: Date = cal.date(from: cal.dateComponents([.year, .month], from: .now))! let end: Date init() { end = cal.date(byAdding: .month, value: 1, to: start)! } var body: some
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: