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:
parent
fd7fb158fb
commit
8380a7a532
@ -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)',
|
||||
|
@ -50,6 +50,7 @@ export const useChartDataSelection = (includedTraffic?: number) => {
|
||||
}
|
||||
},
|
||||
includedTraffic,
|
||||
chartDataSelection.grouping === 'daily',
|
||||
);
|
||||
}, [theme, chartDataSelection, includedTraffic]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user