File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
superset-frontend/plugins/plugin-chart-table/src Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -170,12 +170,21 @@ function cellOffset({
170
170
function cellBackground ( {
171
171
value,
172
172
colorPositiveNegative = false ,
173
+ theme,
173
174
} : {
174
175
value : number ;
175
176
colorPositiveNegative : boolean ;
177
+ theme : SupersetTheme ;
176
178
} ) {
177
- const r = colorPositiveNegative && value < 0 ? 150 : 0 ;
178
- return `rgba(${ r } ,0,0,0.2)` ;
179
+ if ( ! colorPositiveNegative ) {
180
+ return `${ theme . colorFillSecondary } 50` ;
181
+ }
182
+
183
+ if ( value < 0 ) {
184
+ return `${ theme . colorError } 50` ;
185
+ }
186
+
187
+ return `${ theme . colorSuccess } 50` ;
179
188
}
180
189
181
190
function SortIcon < D extends object > ( { column } : { column : ColumnInstance < D > } ) {
@@ -881,6 +890,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
881
890
background-color: ${ cellBackground ( {
882
891
value : value as number ,
883
892
colorPositiveNegative,
893
+ theme,
884
894
} ) } ;
885
895
` }
886
896
` ;
@@ -1089,6 +1099,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
1089
1099
totals ,
1090
1100
columnColorFormatters ,
1091
1101
columnOrderToggle ,
1102
+ theme ,
1092
1103
] ,
1093
1104
) ;
1094
1105
You can’t perform that action at this time.
0 commit comments