-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-iOS: new WWDC23 video {'Explore pie charts and interactivity in Swif…
…t Charts'}.
- Loading branch information
Showing
11 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
title : "Explore pie charts and interactivity in Swift Charts" | ||
abstract: "Learn how to make your charts scrollable, explore the chart selection API for revealing additional details in your data." | ||
|
||
displayToc: true | ||
--- | ||
|
||
# WWDC 2023: Explore pie charts and interactivity in Swift Charts | ||
Find hereafter a detailed summary of a video that belongs to a [taxonomy of some WWDC footages](../../). | ||
|
||
The original video is available on the **Apple official website** ([session 10037](https://developer.apple.com/videos/play/wwdc2023/10037/)). | ||
![](../../../../../images/iOSdev/wwdc23-10037_Poster.png) | ||
"**Swift Charts** has come full circle: Get ready to bake up pie and donut charts in your app with the latest improvements to the framework. Learn how to make your **charts scrollable**, explore the chart selection API for revealing **additional details in your data**, and find out how enabling additional **interactivity** can make your charts even more delightful." | ||
</br>Hereafter, the underlined elements lead directly to the playback of the WWDC video at the appropriate moment. | ||
</br> | ||
|
||
## [New chart](https://developer.apple.com/videos/play/wwdc2023/10037?time=19) | ||
With [strong arguments](https://developer.apple.com/videos/play/wwdc2023/10037?time=46) regarding its usage, the **pie chart** joins the `Swift` `Charts` family along with the new **[SectorMark type](https://developer.apple.com/videos/play/wwdc2023/10037?time=66)**. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10037_1.png) | ||
|
||
Through the [polar space](https://developer.apple.com/videos/play/wwdc2023/10037?time=87), a pie chart can turn into a **donut chart** for an original rendering. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10037_2.png) | ||
|
||
[Few lines of code](https://developer.apple.com/videos/play/wwdc2023/10037?time=106) are necessary to convert a simple chart into a basic pie chart. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10037_3.png) | ||
|
||
And the way to get a **[donut chart](https://developer.apple.com/videos/play/wwdc2023/10037?time=207)** is just as simple as the implemented modifications hereabove. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10037_4.png) | ||
</br> | ||
|
||
## [Selection](https://developer.apple.com/videos/play/wwdc2023/10037?time=259) | ||
To render a popover on top of a selection indicator, follow the milestones hereafter by keeping in mind that the `chartOverlay` modifier is replaced by the **[chartXSelection](https://developer.apple.com/videos/play/wwdc2023/10037?time=326)** modifier as an `iOS` `17` new feature: | ||
|
||
1. Use the new **selection modifier** to get the X-axis raw value ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10037?time=347">🎬</a> | ||
|
||
2. Create a **rule mark** as a selection indicator for the taken value ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10037?time=363">🎬</a> | ||
|
||
3. Use an **annotation** for displaying the sought popover ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10037?time=376">🎬</a> | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10037_6.png) | ||
|
||
Instead of a single value, a **range can also be selected** through [dedicated gestures](https://developer.apple.com/videos/play/wwdc2023/10037?time=427) according to the system you're working on while implementing [customed gestures](https://developer.apple.com/videos/play/wwdc2023/10037?time=441) as well. | ||
|
||
**Pie charts** and **donuts charts** follow the exact [same rules](https://developer.apple.com/videos/play/wwdc2023/10037?time=452) for providing the above detailed selection. | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10037_5.png) | ||
|
||
This kind of selection is also **supported on `macOS`** using a [hover gesture](https://developer.apple.com/videos/play/wwdc2023/10037?time=419) as default instead. | ||
</br> | ||
|
||
## [Scrolling](https://developer.apple.com/videos/play/wwdc2023/10037?time=472) | ||
`iOS` `17` has brought many enhancements for scrolling with `Swift` `Charts` and the example detailed in this part of the video highlights few of them through different steps: | ||
|
||
1. **Enable scrolling** ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10037?time=486">🎬</a> | ||
|
||
2. Plan the **range of data to be visible** on the X-axis ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10037?time=490">🎬</a> | ||
|
||
3. **Store** the selected data to a **binding** ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10037?time=497">🎬</a> | ||
|
||
4. Adapt the **scroll behavior** according to the expectations ⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10037?time=518">🎬</a> | ||
|
||
![](../../../../../images/iOSdev/wwdc23-10037_7.png) | ||
</br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters