Skip to content

Commit

Permalink
fix: echart is incorrectly truncated for emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
Sky-FE committed May 9, 2023
1 parent 0ee3db8 commit 0fbe6dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.1.1",
"description": "my apitable widget chart",
"engines": {
"node": ">=8.x"
Expand Down
8 changes: 7 additions & 1 deletion src/model/echarts_base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,13 @@ export abstract class EchartsBase {
interval: 0,
width: Math.sqrt(2) / 2 * 110, // cos 45 = sqrt(2) / 2
...axisStyle,
overflow: 'truncate',
formatter: (value) => {
const charList = Array.from(value);
if (charList.length > 8) {
return charList.slice(0, 8).join('') + '...';
}
return value;
}
},
axisTick: {
show: true,
Expand Down

0 comments on commit 0fbe6dc

Please sign in to comment.