SwiftUICharts in swiftUI

Using an Example of SwiftUICharts, I have used the following, to create a line chart:

LineView(data: [8,23.5,54.8,32,12,37,7,23,43])

And it works very nicely:-)


However I want to plot x,y rather than just y values

I have tried
Code Block
LineView(data: [1,2,3,4,5,6,7,8,9], [8,23.5,54.8,32,12,37,7,23,43])
(With and without the comma which separates the 2 bracketed “terms”)

And

LineView(data: [(1,8),(2,23.5),(3,54.8),(4,32),(5,12),(6,37),(7,7),(8,23),(9,43)])

All gave errors


Any idea how I should present the data to obtain the x,y line graph?

TIA,

Phil.
SwiftUICharts in swiftUI
 
 
Q