Created
June 12, 2022 10:11
-
-
Save manmal/4eca8908e5db0e8aaa8db4f30fd83dba to your computer and use it in GitHub Desktop.
FB10198317 - Swift Charts: AxisValueLabel color does not change
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
When setting `foregroundStyle` on a `AxisValueLabel`, the rendered text color does not change. | |
Example Code: | |
``` | |
Chart([(0,0), (1,1), (2, 2), (3, 3), (4, 4)], id: \.0) { point in | |
LineMark(x: .value("X", point.0), y: .value("Y", point.1)) | |
} | |
.chartYAxis { | |
AxisMarks { _ in | |
AxisTick() | |
.foregroundStyle(.red) | |
AxisGridLine() | |
.foregroundStyle(.red) | |
AxisValueLabel() | |
.foregroundStyle(.red) | |
} | |
} | |
``` | |
Expected result: The AxisValueLabel is colored red. | |
Actual result: The AxisValueLabel is colored either light gray (dark mode), or dark gray (light mode), but never red. | |
This is a problem because we are often rendering charts in front of a fixed (dark) background. So we need the axis labels to have a certain, colorscheme-independent, color. |
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
https://store-028.blobstore.apple.com/v01/FR/8233/2212/0000/20303202/Screenshot%20on%2012.06.22%20at%2010.47.15.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=MKIA0879Y5FEZQ0RYD6Z%2F20220612%2Fstore-028%2Fs3%2Faws4_request&X-Amz-Date=20220612T101042Z&X-Amz-Expires=15&X-Amz-SignedHeaders=host&X-Amz-Signature=583a388917b29bfa60494121ca4f77d03c5906c8545cf392dab6908bc7db003a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment