1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-31 01:16:01 +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,
tooltipTitleCallback: (tooltipItems: any) => string,
includedTraffic?: number,
showAverageDaily?: boolean,
): ChartOptions<'bar'> => ({
plugins: {
annotation: {
@ -18,7 +19,7 @@ export const createBarChartOptions = (
yMax: includedTraffic ? includedTraffic / 30 : 0,
borderColor: 'gray',
borderWidth: 1,
display: !!includedTraffic,
display: !!includedTraffic && !!showAverageDaily,
label: {
backgroundColor: 'rgba(192, 192, 192, 0.8)',

View File

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