diff --git a/app/src/components/charts/BarChart.js b/app/src/components/charts/BarChart.js index 70d25cf..34d4f5c 100644 --- a/app/src/components/charts/BarChart.js +++ b/app/src/components/charts/BarChart.js @@ -5,6 +5,7 @@ import { } from "@sgratzl/chartjs-chart-boxplot"; import { Chart, registerables } from "chart.js"; import { externalTooltipHandler } from "./helpers"; +import { useTheme } from "@mui/material/styles"; Chart.register(...registerables, BoxPlotController, BoxAndWiskers); import { blue, green, orange, purple, red } from "@mui/material/colors"; @@ -12,6 +13,7 @@ import { alpha } from "@mui/material/styles"; // Import alpha utility if you're const BarChart = (props) => { const { data, chartId, showX, showColors, targets } = props; + const theme = useTheme(); // Function to get color array const muiColors = [blue[500], green[500], orange[500], purple[500], red[500]]; @@ -51,6 +53,7 @@ const BarChart = (props) => { stacked: true, display: showX || (targets && targets.length < 5), ticks: { + color: theme.palette.text.primary, font: { size: 10, }, @@ -79,7 +82,7 @@ const BarChart = (props) => { return () => { myChart.destroy(); }; - }, [data, chartId, showX, targets]); + }, [data, chartId, showX, targets, theme]); return ; }; diff --git a/app/src/components/charts/HorizontalBoxPlot.js b/app/src/components/charts/HorizontalBoxPlot.js index 5794522..028c4c7 100644 --- a/app/src/components/charts/HorizontalBoxPlot.js +++ b/app/src/components/charts/HorizontalBoxPlot.js @@ -5,10 +5,12 @@ import { } from "@sgratzl/chartjs-chart-boxplot"; import { Chart, registerables } from "chart.js"; import { externalTooltipHandler } from "../charts/helpers"; +import { useTheme } from "@mui/material/styles"; Chart.register(...registerables, BoxPlotController, BoxAndWiskers); const HorizontalBoxPlot = (props) => { const { data, chartId } = props; + const theme = useTheme(); useEffect(() => { if (!data) { @@ -64,6 +66,7 @@ const HorizontalBoxPlot = (props) => { min: data.min, max: data.max, ticks: { + color: theme.palette.text.primary, font: { size: 10, }, @@ -81,7 +84,7 @@ const HorizontalBoxPlot = (props) => { return () => { myChart.destroy(); }; - }, [data, chartId]); + }, [data, chartId, theme]); return ; }; diff --git a/app/src/components/charts/StackedBarChart.js b/app/src/components/charts/StackedBarChart.js index efbd385..7340abd 100644 --- a/app/src/components/charts/StackedBarChart.js +++ b/app/src/components/charts/StackedBarChart.js @@ -5,10 +5,13 @@ import { } from "@sgratzl/chartjs-chart-boxplot"; import { Chart, registerables } from "chart.js"; import { externalTooltipHandler } from "./helpers"; +import { useTheme } from "@mui/material/styles"; Chart.register(...registerables, BoxPlotController, BoxAndWiskers); const StackedBarChart = (props) => { const { data, chartId, showX, targets } = props; + const theme = useTheme(); + useEffect(() => { if (!data || data.length === 0) { return; @@ -42,6 +45,7 @@ const StackedBarChart = (props) => { stacked: true, display: showX || categories.length < 5, ticks: { + color: theme.palette.text.primary, font: { size: 10, }, @@ -70,7 +74,7 @@ const StackedBarChart = (props) => { return () => { myChart.destroy(); }; - }, [data, chartId, showX, targets]); + }, [data, chartId, showX, targets, theme]); return ; }; diff --git a/app/src/components/run/EvaluationTable.js b/app/src/components/run/EvaluationTable.js index d39df6d..0c17188 100644 --- a/app/src/components/run/EvaluationTable.js +++ b/app/src/components/run/EvaluationTable.js @@ -4,15 +4,40 @@ import { DataGrid } from "@mui/x-data-grid"; import { Card, CardContent, Typography } from "@mui/material"; import styled from "@emotion/styled"; import BarChart from "../charts/BarChart"; +import { grey } from "@mui/material/colors"; const ChartBox = styled.div` width: 275px; height: 50px; `; +const ChartBoxSmall = styled.div` + width: 135px; + height: 50px; +`; + const columns = [ { field: "measure", headerName: "Evaluation measure", width: 240 }, - { field: "value", headerName: "Value", width: 200 }, + { + field: "value", + headerName: "Value", + width: 200, + renderCell: (params) => { + const parts = params.value.split("±"); + // Check if the split operation found a "±" and thus split the text into two parts + if (parts.length === 2) { + return ( +