Skip to content

Commit

Permalink
-iOS: new WWDC23 video {'Explore pie charts and interactivity in Swif…
Browse files Browse the repository at this point in the history
…t Charts'}.
  • Loading branch information
XLE22 committed Oct 25, 2023
1 parent 57e7f9a commit d4ea14d
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/assets/json/en/ios/wwdc/ios-wwdc-listnota11y.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
"raccourcis": "2023/23SwiftMacros",
"profils": ["All","Swift"]
},
{
"themes": "WWDC 2023",
"title": "Explore pie charts and interactivity in Swift Charts",
"type": ["Charts"],
"tests": [],
"verifier": [],
"resultat": [],
"exception": "",
"raccourcis": "2023/2310037",
"profils": ["All","Swift","SwiftUI"]
},
{
"themes": "WWDC 2023",
"title": "Generalize APIs with parameter packs",
Expand Down
Binary file added src/en/mobile/images/iOSdev/wwdc23-10037_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10037_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10037_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10037_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10037_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10037_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/mobile/images/iOSdev/wwdc23-10037_7.png
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.
67 changes: 67 additions & 0 deletions src/en/mobile/ios/wwdc/nota11y/2023/2310037.md
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&nbsp;chart](https://developer.apple.com/videos/play/wwdc2023/10037?time=19)
With [strong&nbsp;arguments](https://developer.apple.com/videos/play/wwdc2023/10037?time=46) regarding its usage, the **pie chart** joins the `Swift`&nbsp;`Charts` family along with the new **[SectorMark&nbsp;type](https://developer.apple.com/videos/play/wwdc2023/10037?time=66)**.

![](../../../../../images/iOSdev/wwdc23-10037_1.png)

Through the [polar&nbsp;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&nbsp;lines&nbsp;of&nbsp;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&nbsp;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`&nbsp;`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&nbsp;gestures](https://developer.apple.com/videos/play/wwdc2023/10037?time=427) according to the system you're working on while implementing [customed&nbsp;gestures](https://developer.apple.com/videos/play/wwdc2023/10037?time=441) as well.

**Pie charts** and **donuts charts** follow the exact [same&nbsp;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&nbsp;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`&nbsp;`17` has brought many enhancements for scrolling with `Swift`&nbsp;`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>
5 changes: 3 additions & 2 deletions src/en/mobile/ios/wwdc/nota11y/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ The videos that may be of interest to **designers** are highlighted with a **ded

<section class="visually-hidden" id="wwdcTests" aria-hidden="true">
<h2 id="hhwwdc2023" class="pt-5">WWDC 2023</h2>
<p id="hwwdc70">WWDC 2023 Build programmatic UI with Xcode Previews</p>
<p id="hwwdc69">WWDC 2023 Expand on Swift macros</p>
<p id="hwwdc71">WWDC 2023 Build programmatic UI with Xcode Previews</p>
<p id="hwwdc70">WWDC 2023 Expand on Swift macros</p>
<p id="hwwdc69">WWDC 2023 Explore pie charts and interactivity in Swift Charts</p>
<p id="hwwdc68">WWDC 2023 Generalize APIs with parameter packs</p>
<p id="hwwdc67">WWDC 2023 Keynote</p>
<p id="hwwdc66">WWDC 2023 Platforms State of the Union</p>
Expand Down

0 comments on commit d4ea14d

Please sign in to comment.