Sunburst chart having empty wedges/are not full circles

Hello everyone,

I am using plotly graph_objects to create a Sunburst chart to visualize some hierarchical data, however in my current chart:

each parent (Complete score, Ecological, Economical and Social) has an additional empty wedge, which I dont want.

Here are the lists I use to generate the chart (put into a dataframe for ease of reading):

And the code:

fig = Figure()

fig.add_trace(Sunburst(
    labels=labels,
    parents=parents,
    values=values,
    text=scores,
    marker=dict(
        colors=scores,
        colorscale='tealgrn',
        cmid=0),
    hovertemplate='<b>%{label} </b> <br> Score: %{text}',
    name='Visualization Criteria Catalogue'
    ))

fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))

My ideal output would be the same plot, just without the empty spaces.

I am using dummy values (all 1s) so that all wedges show and display the values by using the text parameters.

Hello @ossi,

Welcome to the community!

My guess is that you are encountering issues because you are providing blanks in your data.

If you could structure your data to be something like this:

Values, Category, Subject and then provide a path of [โ€˜Categoryโ€™, โ€˜Subjectโ€™] and values are the values. :wink: