jordibruin / Swift-Charts-Examples

An overview of the different types of charts you can make with Swift Charts
MIT License
1.95k stars 126 forks source link

Previews are broken #86

Closed jordibruin closed 1 year ago

jordibruin commented 1 year ago

Ongoing list of issues with broken previews:

Screen Status
HeatMap Resolved
SoundBars Resolved
ContentView https://github.com/jordibruin/Swift-Charts-Examples/issues/86#issuecomment-1187939093
Pyramid https://github.com/jordibruin/Swift-Charts-Examples/issues/86#issuecomment-1189110360
shiftingsand commented 1 year ago

The 'Text("hello")' is how I got around the problem.

atrinh0 commented 1 year ago

Fixed in main branch.

Issue seems to stem from the chart not handling double values very well.

Screenshot 2022-07-16 at 12 00 21
shiftingsand commented 1 year ago

FYI, other charts (such as SoundBars) look like they have the same problem. Preview won't show.

ambiguous use of operator '-'


CompileDylibError: Failed to build SoundBars.swift

Compiling failed: ambiguous use of operator '-'

Swift-Charts-Examples/Swift Charts Examples/Charts/BarCharts/SoundBars.swift:71:30: error: ambiguous use of operator '-' .chartYScale(domain: -designTimeInteger("#8148.[2].[4].property.[0].[0].modifier[2].arg[0].value.[0]", fallback: 1)...designTimeInteger("#8148.[2].[4].property.[0].[0].modifier[2].arg[0].value.[1]", fallback: 1)) ^ Swift.Float16:3:31: note: found this candidate prefix public static func - (x: Float16) -> Float16 ^ Swift.Float:2:31: note: found this candidate prefix public static func - (x: Float) -> Float ^ Swift.Double:2:31: note: found this candidate prefix public static func - (x: Double) -> Double ^

atrinh0 commented 1 year ago

FYI, other charts (such as SoundBars) look like they have the same problem. Preview won't show.

ambiguous use of operator '-'

CompileDylibError: Failed to build SoundBars.swift

Compiling failed: ambiguous use of operator '-'

Swift-Charts-Examples/Swift Charts Examples/Charts/BarCharts/SoundBars.swift:71:30: error: ambiguous use of operator '-' .chartYScale(domain: -designTimeInteger("#8148.[2].[4].property.[0].[0].modifier[2].arg[0].value.[0]", fallback: 1)...designTimeInteger("#8148.[2].[4].property.[0].[0].modifier[2].arg[0].value.[1]", fallback: 1)) ^ Swift.Float16:3:31: note: found this candidate prefix public static func - (x: Float16) -> Float16 ^ Swift.Float:2:31: note: found this candidate prefix public static func - (x: Float) -> Float ^ Swift.Double:2:31: note: found this candidate prefix public static func - (x: Double) -> Double ^

Soundbars previews fixed via https://github.com/jordibruin/Swift-Charts-Examples/commit/ef801a6958ba6ce413ae7b4a86094676c742a7e4

shiftingsand commented 1 year ago

FYI, the preview for ContentView crashes.

image
shiftingsand commented 1 year ago

Pyramid preview does not work:

image