Hello Swift Charts — Create SwiftUI Graphs for iOS 16 | by José Neves | Jun, 2022

In actual life, it’s normal to have a listing of knowledge to indicate, and for that we don’t create Marks manually, to simplify our life. The Chart initializer can obtain a listing of Identifiable objects and escape a closure with ForEach loop.

One of the crucial highly effective options of Swift Charts is the likelihood to mix a number of marks to create a customized view.

Let’s examine an instance combining LineMark and Level:

Persevering with the instance above, we will additionally mix a number of knowledge classes in the identical chart.

To do that, we have to present some data to chart know the way to cut up knowledge in a number of charts. The simple manner is utilizing the foregroundStyle(by:) modifier passing a PlottableValue to create “classes“.

More Posts