diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index a6acb65fe1..205e7095a5 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -325,6 +325,18 @@ export function getStyle(chart: Chart): Style { p[n.fieldId] = n return p }, {}) || {} + // 下钻字段使用入口字段的宽度 + if (chart.drill) { + const { xAxis } = parseJson(chart) + const curDrillField = chart.drillFields[chart.drillFilters.length] + const drillEnterFieldIndex = xAxis.findIndex( + item => item.id === chart.drillFilters[0].fieldId + ) + const drillEnterField = xAxis[drillEnterFieldIndex] + fieldMap[curDrillField.dataeaseName] = { + width: fieldMap[drillEnterField.dataeaseName]?.width + } + } style.colCfg.width = node => { const width = node.spreadsheet.container.cfg.el.offsetWidth if (!basicStyle.tableFieldWidth?.length) {