mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: Time Comparison Feature Reverts Metric Labels to Metric Keys in Table Charts (#32665)
Co-authored-by: Fardin Mustaque <fardinmustaque@Fardins-Mac-mini.local>
This commit is contained in:
@@ -605,6 +605,8 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
// Calculate the number of placeholder columns needed before the current header
|
||||
const startPosition = value[0];
|
||||
const colSpan = value.length;
|
||||
// Retrieve the originalLabel from the first column in this group
|
||||
const originalLabel = columnsMeta[value[0]]?.originalLabel || key;
|
||||
|
||||
// Add placeholder <th> for columns before this header
|
||||
for (let i = currentColumnIndex; i < startPosition; i += 1) {
|
||||
@@ -620,7 +622,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
// Add the current header <th>
|
||||
headers.push(
|
||||
<th key={`header-${key}`} colSpan={colSpan} style={{ borderBottom: 0 }}>
|
||||
{key}
|
||||
{originalLabel}
|
||||
<span
|
||||
css={css`
|
||||
float: right;
|
||||
@@ -975,7 +977,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
),
|
||||
Footer: totals ? (
|
||||
i === 0 ? (
|
||||
<th>
|
||||
<th key={`footer-summary-${i}`}>
|
||||
<div
|
||||
css={css`
|
||||
display: flex;
|
||||
@@ -997,7 +999,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
</div>
|
||||
</th>
|
||||
) : (
|
||||
<td style={sharedStyle}>
|
||||
<td key={`footer-total-${i}`} style={sharedStyle}>
|
||||
<strong>{formatColumnValue(column, totals[key])[1]}</strong>
|
||||
</td>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user