# Sunburst being empty

**URL:** <https://community.plotly.com/t/sunburst-being-empty/83705>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [April 11, 2024, 11:27am UTC](https://community.plotly.com/t/sunburst-being-empty/83705 "2024-04-11T11:27:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xaver](https://avatars.discourse-cdn.com/v4/letter/x/b4bc9f/32.png) [@xaver](https://community.plotly.com/u/xaver)\
**Post date:** [April 11, 2024, 11:27am UTC](https://community.plotly.com/t/sunburst-being-empty/83705/1 "2024-04-11T11:27:38Z")

</div>

Hi guys,

I have a problem with the Sunburst chart. I have a script that creates a sunburst chart.  
The following input produces an empty/blank svg. The same script for some other data is working as intended. Since I calculate the parent values from the leaves, the values should match. And I also don’t have any negative values included.  
I am very thankful for any ideas 🙂

**EMPTY SVG**

```auto
ids =['id1', 'id2', 'id3', 'id4', 'id5', 'id6', 'id7', 'id8', 'id9']
parents = ['id7', 'id7', 'id7', 'id8', 'id8', 'id8', 'id9', 'id9', '']
labels=['TTM <5<br>Years', 'TTM<br>5-10<br>Years', 'T', 'T', 'T', 'T', 'Buy', 'Sell', ' ']
values = [128.18, 72.98, 19.45, 0.38, 1.53, 6.0, 220.61, 7.91, 228.51]
colors = ['4C81B3', '4C81B3', '4C81B3', 'FFA750', 'FFA750', 'FFA750', '004C93', 'FF8205', 'FFFFFF']

    fig2 = go.Figure(
        go.Sunburst(
            ids=ids,
            labels=labels,
            parents=parents,
            values=values,
            branchvalues='total',
            rotation=90,
            insidetextorientation='radial',
            insidetextfont={"color": "white", "family": "Calibri"},
            marker={"colors": colors},
            sort=False
        ), layout=go.Layout(margin=dict(l=0, r=0, t=0, b=0), width=400, height=400, font=dict(size=14, family="Calibri")))
fig2.write_image("Test.svg")

```

**CORRECT SVG**

```auto
ids =['id1', 'id2', 'id3', 'id4', 'id5', 'id6', 'id7', 'id8', 'id9']
parents =['id7', 'id7', 'id7', 'id8', 'id8', 'id8', 'id9', 'id9', '']
labels=['TTM <5<br>Years', 'TTM<br>5-10<br>Years', 'T', 'T', 'T', 'T', 'Buy', 'Sell', ' ']
values =[106.31, 117.77, 20.06, 0.21, 4.49, 3.82, 244.14, 8.520000000000001, 252.66]
colors =['4C81B3', '4C81B3', '4C81B3', 'FFA750', 'FFA750', 'FFA750', '004C93', 'FF8205', 'FFFFFF']
fig2 = go.Figure(
        go.Sunburst(
            ids=ids,
            labels=labels,
            parents=parents,
            values=values,
            branchvalues='total',
            rotation=90,
            insidetextorientation='radial',
            insidetextfont={"color": "white", "family": "Calibri"},
            marker={"colors": colors},
            sort=False
        ), layout=go.Layout(margin=dict(l=0, r=0, t=0, b=0), width=400, height=400, font=dict(size=14, family="Calibri")))
fig2.write_image("Test.svg")

```

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/6/e/6e02b0648819cef045e3dd2207160659abf08781.jpeg)

---

<div class="post-metadata">

**Author:** ![davidharris](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@davidharris](https://community.plotly.com/u/davidharris)\
**Post date:** [April 12, 2024, 8:00pm UTC](https://community.plotly.com/t/sunburst-being-empty/83705/2 "2024-04-12T20:00:17Z")

</div>

Not sure what to say, but…

The value for a parent has to be at least as large as the sum of the values for its children, so the final value has to be at least 220.61 + 7.91 = 228.52, not 228.51

---

<div class="post-metadata">

**Author:** ![xaver](https://avatars.discourse-cdn.com/v4/letter/x/b4bc9f/32.png) [@xaver](https://community.plotly.com/u/xaver)\
**Post date:** [April 12, 2024, 9:02pm UTC](https://community.plotly.com/t/sunburst-being-empty/83705/3 "2024-04-12T21:02:07Z")

</div>

Ok, then there hast du be some rounding issues happening in between. I am calculating all parent values as pandas sums. I‘ll have a look into that.

Gesendet von [Outlook für iOS](https://aka.ms/o0ukef)

---

<div class="post-metadata">

**Author:** ![davidharris](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@davidharris](https://community.plotly.com/u/davidharris)\
**Post date:** [April 13, 2024, 6:50am UTC](https://community.plotly.com/t/sunburst-being-empty/83705/4 "2024-04-13T06:50:41Z")

</div>

OK. I should also have said, if you run the version that doesn’t work, an informative error message appears in the browser developer tools console.
