AppPear / ChartView

ChartView made in SwiftUI
MIT License
5.26k stars 645 forks source link

Additional Data Models #231

Closed jcarltonj closed 2 years ago

jcarltonj commented 2 years ago

This PR allows the user of the package to use more custom data objects. This allows the user to select a key path on the data they wish to use for graphing and easily swap. In addition it exposes the ChartValue object so the user can bind and create more custom headings when dragging is enabled.

Description

This PR allows the user of the package to use more custom data objects. This allows the user to select a key path on the data they wish to use for graphing and easily swap. In addition it exposes the ChartValue object so the user can bind and create more custom headings when dragging is enabled.

It also solves a bug that would show an empty graph if all values were zero and adds a custom color to the LineChart indicator point

Motivation and Context

The main purpose of this change is to allow the user more flexibility while viewing the graph.

How Has This Been Tested?

I incorporated the changes in my project. The previews work and it should have no impact on existing code.

Screenshots (if appropriate):

Types of changes

Checklist: