import dash
import dash_table
import pandas as pd
data = {'value':['very low','low','medium','high','very high'],'data':[1,3,5,7,10]}
df = pd.DataFrame(data)
app = dash.Dash(__name__)
app.layout = dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in df.columns],
data=df.to_dict('records'),
)
if __name__ == '__main__':
app.run_server(debug=True)
But I want to generate the below table. How can i do this using dash? The indicator column is a shape that is color coded based on a scale (For eg. 5 is medium and hence yellow/amber , above 5 the value go from green to dark green . Similarly, values below 5 go from amber to red
Hey thank you for this. I was looking at conditional formatting but that doesn’t seem to solve what I want to achieve. Since the coloring of the arrows has to be done using probably a gradient scale, I’m thinking one way of this might be adding the arrow icon as a column to the dataframe and then formatting it. Maybe using fontawesome arrows might help?
My suggestion is using emojis like and as described in the link and then a background color and padding to colored around the arrow.
Or directly shown the texts ‘very low’,‘low’,‘medium’,‘high’,‘very high’ with the Respective Background color.
Another way could be using images, I do not know if it is possible in tables, I used this solution with a marquee:
You can see how it shows the different market up an down here: https://companyanalysis.herokuapp.com/