How to add duplicates in sunburst chart?

I am doing a Sunburst chart Ticket booking app using django.In that the chart needs to show 3 layers of data like Events,Slots,Categories.i have already done the work but it doesnot allow duplicate event names and slot names so please check the code and give me idea . In my project there may be so many events can have same and slots of every events may have same …so give me code or idea to do it.

code:

def sunburst_chart(request):
events = event_master.objects.filter(client_id=request.user.id)
slots = event_slots.objects.filter(client_id=request.user.id)
categories = event_ticket_category.objects.filter(client_id=request.user.id)

data = []

for event in events:
    eventslots = slots.filter(event_master_id=event.id)

    if not eventslots:
        data.append({'path_0': event.Event_Name})
    else:
        for slot in eventslots:
            categories_slot = categories.filter(event_slots_id=slot.id)

            if not categories_slot:
                data.append({'path_0': event.Event_Name, 'path_1': slot.Slot_Name})
            else:
                for category in categories_slot:
                    data.append({'path_0': event.Event_Name, 'path_1': slot.Slot_Name, 'path_2': category.Category_Name})

df = pd.DataFrame(data)

fig = px.sunburst(df, path=['path_0', 'path_1', 'path_2'])

plot_html = fig.to_html(full_html=True)
context = {'plot_html': plot_html}
return render(request, 'K_ticket/sunburstChat.html', context)

Duplicates are not admitted, as far as I know from my experience with sunbursts. I fixed this issue by adding a new character to a repeating string, usually a digit 1, 2, …

1 Like

ok i will try that

but name should be maintained in some case means how should i achieve it.

I don’ t understandand your question. Please add a dot at the end of a sentence.

is this method really work to add duplicate in sunbrust chart?