Replies: 1 comment
-
In the meantime I'm changing my charts to look good using surface/onSurface colorScheme instead of background :-) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I tried using charts in a color scheme where the surface color is different than the background color in a Material 3 color scheme. If a pie chart for example is composed, and the pie chart size is constrained by the width, then when the chart is composed and centered as expected, a block of the scheme's surface (not background) color is displayed above and below the chart. This is caused by the use of Surface (not Box) as a top container for the chart layout stuff (see line 100 in DonutPieChart.kt), and the Surface uses the theme's surface color of course. It seems the only way to stop the color blocks is to force a different MaterialTheme color scheme where background and surface colors are the same, just for charts.
What is Surface buying here over Box for the charts? I noticed StackedBarChart does the same, so I'm guessing all the chart functions use Surface :-)
Beta Was this translation helpful? Give feedback.
All reactions