mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
Adjust x-axis labels when record count is greater than 25
This commit is contained in:
parent
ae8f642720
commit
f306107a38
@ -48,11 +48,17 @@ export default function BarChart({
|
|||||||
case 'hour':
|
case 'hour':
|
||||||
return dateFormat(d, 'p', locale);
|
return dateFormat(d, 'p', locale);
|
||||||
case 'day':
|
case 'day':
|
||||||
if (records > 31) {
|
if (records > 25) {
|
||||||
if (sw <= 250) {
|
if (sw <= 275) {
|
||||||
return index % 10 === 0 ? dateFormat(d, 'M/d', locale) : '';
|
return index % 10 === 0 ? dateFormat(d, 'M/d', locale) : '';
|
||||||
}
|
}
|
||||||
return index % 5 === 0 ? dateFormat(d, 'M/d', locale) : '';
|
if (sw <= 550) {
|
||||||
|
return index % 5 === 0 ? dateFormat(d, 'M/d', locale) : '';
|
||||||
|
}
|
||||||
|
if (sw <= 700) {
|
||||||
|
return index % 2 === 0 ? dateFormat(d, 'M/d', locale) : '';
|
||||||
|
}
|
||||||
|
return dateFormat(d, 'MMM d', locale);
|
||||||
}
|
}
|
||||||
if (sw <= 375) {
|
if (sw <= 375) {
|
||||||
return index % 2 === 0 ? dateFormat(d, 'MMM d', locale) : '';
|
return index % 2 === 0 ? dateFormat(d, 'MMM d', locale) : '';
|
||||||
|
Loading…
Reference in New Issue
Block a user