I want customcolor for color value to darken for large percentages and fade to small percentage in green and red scale
As far as I know is to use color_continous_scale in the treemap but I tried and don’t know what to replace? someone help me ?
My code here:
fig = px.treemap(Day_changes_USDT, path=[('all'),'Stablecoins','Symbols','Value','Percentage'],
values='Rate_Value', color='Percentage',
color_continuous_scale=['red','white','green']
)
fig.update_traces(textinfo = "label",
textposition="middle center",
# hovertemplate='%{label: labels }%<br>value=$%{value}<extra></extra>',
# texttemplate='%{label: labels }% <br> $%{value: 0.2s}')
hovertemplate='%{label: labels }%',
texttemplate='%{label: labels }%'
)
fig.update_traces(hovertext=['Percentage'])
fig.update_layout(width=1400, height=800,title="TreeMap {}".format(today),paper_bgcolor='rgba(225,225,225,225)',title_font_size=20)
fig.data[0]['textfont']['size'] = 16
fig.data[0].hovertemplate='Name: %{parent}'+ '<br>Value: %{label}%'
fig.show()