diff --git a/package.json b/package.json index e5bac80..a3c1c45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cameleer/design-system", - "version": "0.1.47", + "version": "0.1.48", "type": "module", "main": "./dist/index.es.js", "module": "./dist/index.es.js", diff --git a/src/design-system/composites/ThemedChart/ThemedChart.tsx b/src/design-system/composites/ThemedChart/ThemedChart.tsx index 888f880..c078e03 100644 --- a/src/design-system/composites/ThemedChart/ThemedChart.tsx +++ b/src/design-system/composites/ThemedChart/ThemedChart.tsx @@ -36,6 +36,12 @@ export function ThemedChart({ return null } + // Show ~5-6 ticks max to avoid label overlap + const maxTicks = 6 + const tickInterval = data.length > maxTicks + ? Math.ceil(data.length / maxTicks) - 1 + : 0 + return (
@@ -46,6 +52,8 @@ export function ThemedChart({ type={xType} {...rechartsTheme.xAxis} tickFormatter={xTickFormatter} + interval={tickInterval} + minTickGap={40} />