Heart rate chart redesign#159
Open
tituscmd wants to merge 6 commits intoInfiniTimeOrg:rebuildfrom
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey all!
This PR reworks the heart rate chart to more closely match the style of Apple Health.
Instead of the previous line/area chart, it now uses a range bar chart that groups readings by the hour, showing the min/max range as a darker bar and the average of that hour as a brighter dot overlaid on top. The header still shows the BPM range and date for the day you're currently viewing, and now fluidly updates when you navigate to a different day.
Since smooth horizontal scrolling requires iOS 17+, I went with a chevron-based day navigation approach instead to keep things compatible with iOS 16. The chart fetches up to a week of data, using the existing weekPredicate in ChartManager, instead of the previously used dayPredicate. Only the data from the current week is fetched, not the last 7 days, similar to how the step chart operates.
The Y axis scales dynamically to the visible data rather than being hardcoded, which I think makes it a lot more readable especially when readings are close together.
Hope you like it 🙂