Adjust Bar Chart x-axis labels to prevent overlap

This commit is contained in:
Sammy-T 2021-03-16 03:55:21 -04:00
parent f8ac987bfc
commit 4b9e7e9218

View File

@ -54,9 +54,12 @@ export default function BarChart({
} }
return index % 5 === 0 ? dateFormat(d, 'M/d', locale) : ''; return index % 5 === 0 ? dateFormat(d, 'M/d', locale) : '';
} }
if (w <= 500) { if (w <= 750) {
return index % 2 === 0 ? dateFormat(d, 'MMM d', locale) : ''; return index % 2 === 0 ? dateFormat(d, 'MMM d', locale) : '';
} }
if (w <= 850) {
return dateFormat(d, 'MMM d', locale);
}
return dateFormat(d, 'EEE M/d', locale); return dateFormat(d, 'EEE M/d', locale);
case 'month': case 'month':
if (w <= 660) { if (w <= 660) {