Added more colors to the Charts

This commit is contained in:
Tiago Ribeiro
2023-04-21 11:58:42 +01:00
parent ed11d6f9d6
commit 713771d949
4 changed files with 100 additions and 17 deletions

View File

@@ -9,11 +9,12 @@ interface Props {
label?: string;
title: string;
type: string;
colors?: string[];
}
ChartJS.register(RadialLinearScale, ArcElement, Tooltip, Legend);
export default function UserResultChart({data, type, label, title}: Props) {
export default function SingleDatasetChart({data, type, label, title, colors = Object.values(SEMI_TRANSPARENT)}: Props) {
const labels = data.map((x) => x.label);
const chartData = {
labels,
@@ -21,7 +22,7 @@ export default function UserResultChart({data, type, label, title}: Props) {
{
label,
data: data.map((x) => x.value),
backgroundColor: Object.values(SEMI_TRANSPARENT),
backgroundColor: colors,
},
],
};