From 3d2a03ca22c63c7ce9f3a690a46a4213c04808d9 Mon Sep 17 00:00:00 2001 From: Damien Coraboeuf Date: Sat, 7 Dec 2024 08:31:48 +0100 Subject: [PATCH] #1365 Fixing some issues in the stability chart --- ontrack-web-core/components/charts/CountChart.js | 14 ++++++++------ .../components/charts/PercentageChart.js | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ontrack-web-core/components/charts/CountChart.js b/ontrack-web-core/components/charts/CountChart.js index 79f194488e..bf2737a60f 100644 --- a/ontrack-web-core/components/charts/CountChart.js +++ b/ontrack-web-core/components/charts/CountChart.js @@ -3,7 +3,13 @@ import {useEffect, useState} from "react"; import {Bar, CartesianGrid, ComposedChart, Legend, Tooltip, XAxis, YAxis} from "recharts"; import ChartContainer from "@components/charts/ChartContainer"; -export default function CountChart({query, variables, yTickFormatter}) { +export default function CountChart({ + query, + variables, + yTickFormatter, + legendFormatter = () => "Count ", + domain, + }) { const client = useGraphQLClient() @@ -40,10 +46,6 @@ export default function CountChart({query, variables, yTickFormatter}) { } }, [client, query, variables]); - const legendFormatter = (value, entry, index) => { - return "Count" - } - const [inactiveSeries, setInactiveSeries] = useState([]) const legendClick = ({dataKey}) => { @@ -62,7 +64,7 @@ export default function CountChart({query, variables, yTickFormatter}) { > - + diff --git a/ontrack-web-core/components/charts/PercentageChart.js b/ontrack-web-core/components/charts/PercentageChart.js index 24c829a2be..32374dcca3 100644 --- a/ontrack-web-core/components/charts/PercentageChart.js +++ b/ontrack-web-core/components/charts/PercentageChart.js @@ -8,7 +8,9 @@ export default function PercentageChart({query, variables}) { "%"} + domain={[0, 100]} /> )