Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Adjust Bar Chart x-axis labels to prevent overlap

Sammy-T4b9e7e9218c6
diff --git a/components/metrics/BarChart.js b/components/metrics/BarChart.js
index 856e81e83..391f869b3 100644
--- a/components/metrics/BarChart.js
+++ b/components/metrics/BarChart.js
@@ -54,9 +54,12 @@ export default function BarChart({
}
return index % 5 === 0 ? dateFormat(d, 'M/d', locale) : '';
}
- if (w <= 500) {
+ if (w <= 750) {
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);
case 'month':
if (w <= 660) {