I have a hard time figuring out how to apply:
style_cell_conditional=[
{‘if’: {‘column_id’: ‘Iznos_prodaje’, ‘filter_query’: ‘{Iznos_prodaje} >= 1085000’},
‘background’:‘#3D9970’,
‘color’: ‘white’},
{‘if’: {‘column_id’: ‘Iznos_prodaje’, ‘filter_query’: ‘{Iznos_prodaje} < 1085000’},
‘background’:‘red’,
‘color’: ‘white’},
],
to work after I apply: .apply(lambda x: ‘${:,.2f}’.format(x)) on my “Iznos_prodaje” column.
My goal is to have formatting like this: $1,231,691.92 and still to be able to have style cell conditional applied.
I’ve tried all, and It seems that after column formatting, values become strings, but current conditional only works with columns where numbers are not formatted.
Please check my app to have better picture what i am talking about:
Check out this section of the docs for how to format numbers in the DataTable:
Formatting the numbers this way keeps the data numeric - so then the conditional formatting will still work.
And for something completely different - you can see how this is done using the new Dash AG Grid component
Tank you for your reply. I’ve tried Format Template Group, Render, and still is the same. Formatting gets applied but conditionals don’t. Will see about the option with AgGrid.