0👍
Found the way to query
views.py
from django.db.models import Count
def dashboard(request):
mar_count = Marketplace.objects.annotate(infringement_count=Count('infringement'))
context= {'mar_count': mar_count}
return render(request, 'base/dashboard.html', context)
dashboard.html
{% for m in mar_count %}'{{m.infringement_count}}',{% endfor %}
- [Chartjs]-Different gridline steps on chart js line chart
- [Chartjs]-How to format x-axis time scale values in Chart.js v2
Source:stackexchange.com