A simple chart library using purely swiftui, enabling support for all platforms from Apple
SimpleChart
SimpleChart is a package developed for our company, with the intent of sharing to the developer community. As you may know, there are already a lot of SwiftUI charting library. This is yet another implementations.
Supported platforms include iOS v13, macOS v10.15, tvOS v13, watchOS v6, macCatalyst v.13. Basically all SwiftUI support platforms are supported.
What makes this package different? SimpleChart provides utility methods for you to create the chartData list, which is the only necessary parameter for all of our charts config object. To use the provided convinence method, import SimpleChart, call SCManager and the associated methods. SCManager is the manager for all methods provided by this package. SCManager is a shared instance and it is a singleton object.
Available Charts:
- Bar Chart
- Histogram
- Line Chart
- Quad Curve (curved version of line chart)
- Range Chart (a chart to represent the range of data within the same time period, similar to heart rate range representation in Apple Health app)
All convinence method either accept [Double] or [Int] as an input, except for the following methods:
SCManager.getRangeChartData()
This methods accept both [Double] or [Int], as the “lower” and “upper” argument, along with a list of named tuple (lower: [Double], upper: [Double]) or (lower: [Int], upper: [Int]) for the “data” argument.
All customizations will be done in the config object. You may see the initializer for all of the possible customizations. A special case is that the baseZero might be overrided by the initializer if the data input include negative number.
Pending to implement:
- Legend and associated customizations
- Label for each axis
The above customizations are already included in the config object, but not implemented in the actual chart views. More customizations will be coming and support and pull request are welcome.