1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-14 01:16:17 +02:00

fix(frontend): Now only shows average daily requests when viewing daily (#9758)

As reported by Ivar, there's no point in displaying the average daily
traffic when grouping monthly.
This commit is contained in:
Christopher Kolstad 2025-04-15 10:38:56 +02:00 committed by GitHub
parent fd7fb158fb
commit 8380a7a532
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ export const createBarChartOptions = (
theme: Theme, theme: Theme,
tooltipTitleCallback: (tooltipItems: any) => string, tooltipTitleCallback: (tooltipItems: any) => string,
includedTraffic?: number, includedTraffic?: number,
showAverageDaily?: boolean,
): ChartOptions<'bar'> => ({ ): ChartOptions<'bar'> => ({
plugins: { plugins: {
annotation: { annotation: {
@ -18,7 +19,7 @@ export const createBarChartOptions = (
yMax: includedTraffic ? includedTraffic / 30 : 0, yMax: includedTraffic ? includedTraffic / 30 : 0,
borderColor: 'gray', borderColor: 'gray',
borderWidth: 1, borderWidth: 1,
display: !!includedTraffic, display: !!includedTraffic && !!showAverageDaily,
label: { label: {
backgroundColor: 'rgba(192, 192, 192, 0.8)', backgroundColor: 'rgba(192, 192, 192, 0.8)',

View File

@ -50,6 +50,7 @@ export const useChartDataSelection = (includedTraffic?: number) => {
} }
}, },
includedTraffic, includedTraffic,
chartDataSelection.grouping === 'daily',
); );
}, [theme, chartDataSelection, includedTraffic]); }, [theme, chartDataSelection, includedTraffic]);