Hi all, 

I have a requirement where I need to display multiple pie charts based on 
multiple lists. 

Currently, I am able to display one pie chart involving 2 lists. Below is 
the views.py code for the same: 

# Create your views here.
from django.shortcuts import render

def pie_chart(request):
    labels = ["A", "B", "C"]
    data = ["10", "15", "2"]

   return render(request, 'pie_chart.html', {
        'labels': labels,
        'data': data,
    })

Now what if we have another pair of lists as follows: 
    labels1 = ["X", "Y", "Z"]
    data1 = ["10", "15", "2"]

So can anyone say what changes should I made in the above code  to display 
2 pie charts displaying labels/data and labels1/data1 ? 

Thanks in advance. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8308ffd5-68f5-47ff-883d-05b6a22795c8%40googlegroups.com.

Reply via email to