mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
feat: conditional coloring for big number chart (#23064)
Co-authored-by: Gerold Busch <gerold.busch@valtech.com>
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import {
|
||||
ColorFormatters,
|
||||
getColorFormatters,
|
||||
} from '@superset-ui/chart-controls';
|
||||
import {
|
||||
getNumberFormatter,
|
||||
GenericDataType,
|
||||
@@ -40,6 +44,7 @@ export default function transformProps(
|
||||
forceTimestampFormatting,
|
||||
timeFormat,
|
||||
yAxisFormat,
|
||||
conditionalFormatting,
|
||||
} = formData;
|
||||
const refs: Refs = {};
|
||||
const { data = [], coltypes = [] } = queriesData[0];
|
||||
@@ -71,6 +76,12 @@ export default function transformProps(
|
||||
|
||||
const { onContextMenu } = hooks;
|
||||
|
||||
const defaultColorFormatters = [] as ColorFormatters;
|
||||
|
||||
const colorThresholdFormatters =
|
||||
getColorFormatters(conditionalFormatting, data, false) ??
|
||||
defaultColorFormatters;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
@@ -81,5 +92,6 @@ export default function transformProps(
|
||||
subheader: formattedSubheader,
|
||||
onContextMenu,
|
||||
refs,
|
||||
colorThresholdFormatters,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user