From 717c07d512d6822aa74ef1ed67fa2a5366e8af37 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Thu, 26 Oct 2023 18:53:01 +1300 Subject: [PATCH] Fix font color of app bar chart --- AppBarChart.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AppBarChart.tsx b/AppBarChart.tsx index ccdf630..cbaa8ee 100644 --- a/AppBarChart.tsx +++ b/AppBarChart.tsx @@ -1,5 +1,6 @@ import { useWindowDimensions } from "react-native"; import { PieChart } from "react-native-chart-kit"; +import { useTheme } from "react-native-paper"; export interface Option { value: number; @@ -8,6 +9,7 @@ export interface Option { export default function AppBarChart({ options }: { options: Option[] }) { const { width } = useWindowDimensions(); + const { colors } = useTheme(); const pieChartColors = [ "#1f77b4", // Blue @@ -24,7 +26,7 @@ export default function AppBarChart({ options }: { options: Option[] }) { name: option.label, value: option.value, color: pieChartColors[index], - legendFontColor: "white", + legendFontColor: colors.onSurface, legendFontSize: 15, }));