AppPear / ChartView

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

App Crashes when following the How to create your first chart #234

Closed YoelL closed 2 years ago

YoelL commented 2 years ago

Followed the Beta 2 how to page and got a crash.

Description

Console Message: SwiftUI/EnvironmentObject.swift:70: Fatal error: No ObservableObject of type ChartStyle found. A View.environmentObject(_:) for ChartStyle may be missing as an ancestor of this view.

Expected Behavior

See a line/ bar chart

Actual Behavior

App crashes

Possible Fix

Steps to Reproduce

Follow this: https://github.com/AppPear/ChartView/wiki/How-to-create-your-first-chart

Your Environment

YoelL commented 2 years ago
Screen Shot 2022-01-19 at 12 25 22 Screen Shot 2022-01-19 at 12 25 08
kashif-izhar commented 2 years ago

@YoelL I see that you closed this issue. What was the resolution? I am having the same crash.

HengJayWang commented 2 years ago

@YoelL I see that you closed this issue. What was the resolution? I am having the same crash.

I think the .chartStyle( ) modifier must need to add.

YoelL commented 2 years ago

Hi, yes it was probably that.