Fix font color of app bar chart
This commit is contained in:
parent
e0b2adbb66
commit
717c07d512
|
@ -1,5 +1,6 @@
|
||||||
import { useWindowDimensions } from "react-native";
|
import { useWindowDimensions } from "react-native";
|
||||||
import { PieChart } from "react-native-chart-kit";
|
import { PieChart } from "react-native-chart-kit";
|
||||||
|
import { useTheme } from "react-native-paper";
|
||||||
|
|
||||||
export interface Option {
|
export interface Option {
|
||||||
value: number;
|
value: number;
|
||||||
|
@ -8,6 +9,7 @@ export interface Option {
|
||||||
|
|
||||||
export default function AppBarChart({ options }: { options: Option[] }) {
|
export default function AppBarChart({ options }: { options: Option[] }) {
|
||||||
const { width } = useWindowDimensions();
|
const { width } = useWindowDimensions();
|
||||||
|
const { colors } = useTheme();
|
||||||
|
|
||||||
const pieChartColors = [
|
const pieChartColors = [
|
||||||
"#1f77b4", // Blue
|
"#1f77b4", // Blue
|
||||||
|
@ -24,7 +26,7 @@ export default function AppBarChart({ options }: { options: Option[] }) {
|
||||||
name: option.label,
|
name: option.label,
|
||||||
value: option.value,
|
value: option.value,
|
||||||
color: pieChartColors[index],
|
color: pieChartColors[index],
|
||||||
legendFontColor: "white",
|
legendFontColor: colors.onSurface,
|
||||||
legendFontSize: 15,
|
legendFontSize: 15,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user