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

Improve candle chart annotation performance and fix truncated edges #67

Closed atrinh0 closed 2 years ago

atrinh0 commented 2 years ago

Fixes https://github.com/jordibruin/Swift-Charts-Examples/issues/65

Before

https://user-images.githubusercontent.com/16542463/175368631-528b8271-9144-47e1-abe6-2e6de83e656e.mp4

After

https://user-images.githubusercontent.com/16542463/175368446-64f04acf-b777-44f0-bf0b-1fb70c92f0d3.mp4

jordibruin commented 2 years ago

@tommy-holmes have a look at @atrinh0 ’a approach 🙂

atrinh0 commented 2 years ago

@tommy-holmes have a look at @atrinh0 ’a approach 🙂

Basically the same implementation as the original Apple sample code.

tommy-holmes commented 2 years ago

Yeah that is much more smooth I like it, thanks for showing me! I guess you won't be needing the annotationOffset State var or the DateBins anymore either 😉