Skip to content

Instantly share code, notes, and snippets.

@muhammadabbas001
Created December 23, 2023 18:08
Show Gist options
  • Save muhammadabbas001/29c6a2d261fcc17569796776bcd48d04 to your computer and use it in GitHub Desktop.
Save muhammadabbas001/29c6a2d261fcc17569796776bcd48d04 to your computer and use it in GitHub Desktop.
var chartData : [LineChartData] = {
let sampleDate = Date().startOfDay.adding(.month, value: -10)!
var temp = [LineChartData]()
// Line 1
for i in 0..<8 {
let value = Double.random(in: 5...20)
temp.append(
LineChartData(
date: sampleDate.adding(.month, value: i)!,
value: value,
type: .outside
)
)
}
// Line 2
for i in 0..<8 {
let value = Double.random(in: 5...20)
temp.append(
LineChartData(
date: sampleDate.adding(.month, value: i)!,
value: value,
type: .optimal
)
)
}
return temp
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment