Skip to content

Commit 6fd836e

Browse files
committed
truncate category x axis label to 20 charts
1 parent 4867896 commit 6fd836e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/web/src/components/v2Editor/customBlocks/visualizationV2/VisualizationView.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,13 @@ function getCategoryAxis(axis: XAxis) {
11191119
axisLabel: {
11201120
hideOverlap: true,
11211121
interval: 0,
1122+
formatter: (value: string | number): string => {
1123+
if (typeof value === 'number') {
1124+
return value.toString()
1125+
}
1126+
1127+
return value.length > 20 ? value.slice(0, 20) + '...' : value
1128+
},
11221129
},
11231130
splitLine: {
11241131
show: false,

0 commit comments

Comments
 (0)