How can I display percentage subtotals at each category level in treemap chart?

I am looking to display % of total upper category values at each category and sub-category level in a treemap chart. Is there a way to do this ?

For example, I would want to display % of total for FR CANOTAJ , then % of FR CANOTAJ for ā€œRecompense Monetareā€ and ā€œFinantare Federatieā€, and so on… Do I need that data calculated in the original df, or is plotly able to do this by itself ?

fig = px.treemap(df,
                 path=['Federatia',"Functional Category","Sursa"],
                 values='Suma EUR')

fig.update_layout(title={'text': "2021: Finanțare Bugetară Federații Naționale",
                         'y':0.93,
                         'x':0.5,
                         'xanchor': 'center',
                         'yanchor': 'top'},
                  font=dict(family="Arial",
                            size=18,
                            color='#000000'),
                  width=1300, height=850)
fig.data[0].textinfo = 'label+text+value'

fig.update_layout(annotations=[
       go.layout.Annotation(
            showarrow=True,
            text='Subtitle',
            xanchor='left',
            x=20,
            xshift=275,
            yanchor='top',
            y=0.5,
            font=dict(
                family="Courier New, monospace",
                size=20,
                color="#0000FF"
            )
        )])



fig.show()

Try ā€œpercent {parent|root|entry}ā€, details below:

textinfo: determines which trace information appear on the graph that can be ā€˜text’, ā€˜value’, ā€˜current path’, ā€˜percent root’, ā€˜percent entry’, and ā€˜percent parent’, or any combination of them.

Thank you @PlotThis .

Just to clarify, what’s the exact syntax of that ?

fig.data[0].textinfo = 'percent {parent|root|entry}'

?

Doesnt seem to work

Blockquote
ValueError:
Invalid value of type ā€˜builtins.str’ received for the ā€˜textinfo’ property of treemap
Received value: ā€˜percent {parent|root|entry}’

The 'textinfo' property is a flaglist and may be specified
as a string containing:
  - Any combination of ['label', 'text', 'value', 'current path', 'percent root', 'percent entry', 'percent parent'] joined with '+' characters
    (e.g. 'label+text')
    OR exactly one of ['none'] (e.g. 'none')