mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix(table-chart): fix cell bar visibility in dark theme (#35211)
This commit is contained in:
@@ -170,12 +170,21 @@ function cellOffset({
|
||||
function cellBackground({
|
||||
value,
|
||||
colorPositiveNegative = false,
|
||||
theme,
|
||||
}: {
|
||||
value: number;
|
||||
colorPositiveNegative: boolean;
|
||||
theme: SupersetTheme;
|
||||
}) {
|
||||
const r = colorPositiveNegative && value < 0 ? 150 : 0;
|
||||
return `rgba(${r},0,0,0.2)`;
|
||||
if (!colorPositiveNegative) {
|
||||
return `${theme.colorFillSecondary}50`;
|
||||
}
|
||||
|
||||
if (value < 0) {
|
||||
return `${theme.colorError}50`;
|
||||
}
|
||||
|
||||
return `${theme.colorSuccess}50`;
|
||||
}
|
||||
|
||||
function SortIcon<D extends object>({ column }: { column: ColumnInstance<D> }) {
|
||||
@@ -881,6 +890,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
background-color: ${cellBackground({
|
||||
value: value as number,
|
||||
colorPositiveNegative,
|
||||
theme,
|
||||
})};
|
||||
`}
|
||||
`;
|
||||
@@ -1089,6 +1099,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
totals,
|
||||
columnColorFormatters,
|
||||
columnOrderToggle,
|
||||
theme,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user