Skip to content

Commit ff60e1f

Browse files
committed
feat: improve long text display in table chart
#776
1 parent 973aa9b commit ff60e1f

File tree

1 file changed

+22
-0
lines changed
  • frontend/src/views/chat/component/charts

1 file changed

+22
-0
lines changed

frontend/src/views/chat/component/charts/Table.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,28 @@ export class Table extends BaseChart {
115115
operation: {
116116
sort: true,
117117
},
118+
dataCell: {
119+
enable: true,
120+
content: (cell) => {
121+
const meta = cell.getMeta()
122+
const container = document.createElement('div')
123+
container.style.padding = '8px 0'
124+
container.style.minWidth = '100px'
125+
container.style.maxWidth = '400px'
126+
container.style.display = 'flex'
127+
container.style.alignItems = 'center'
128+
container.style.padding = '8px 16px'
129+
container.style.cursor = 'pointer'
130+
container.style.color = '#606266'
131+
container.style.fontSize = '14px'
132+
container.style.whiteSpace = 'pre-wrap'
133+
134+
const text = document.createTextNode(meta.fieldValue)
135+
container.appendChild(text)
136+
137+
return container
138+
},
139+
},
118140
},
119141
// 如果有省略号, 复制到的是完整文本
120142
interaction: {

0 commit comments

Comments
 (0)