

{% load i18n %}
<div class="user_poll_chart"   >
	<small> {% trans 'User votes' %}</small>
	<canvas id="{{id}}_user_pool_chart_{{user.pk}}" width="30" height="30"></canvas>
	
	<script>
{% if as_view %}
(function(){
{%else%}
document.addEventListener("DOMContentLoaded", function(event){
{% endif%}
		var ctx = document.getElementById("{{id}}_user_pool_chart_{{user.pk}}").getContext("2d");
		
var myChart = new Chart(ctx, {
    type: 'pie',
    data: {
        labels: ['\u2605', '\u2605\u2605', "\u2605\u2605\u2605", 
        '\u2605\u2605\u2605\u2605', '\u2605\u2605\u2605\u2605\u2605' ],
        datasets: [{
            label: '{% trans "Articule votes" %}',
            data: [{{stats.1}}, {{stats.2}}, {{stats.3}},  {{stats.4}},  {{stats.5}},],
            backgroundColor: [
                'rgba(255, 99, 132, 0.2)',
                'rgba(54, 162, 235, 0.2)',
                'rgba(255, 206, 86, 0.2)',
                'rgba(150, 6, 86, 0.2)',
                'rgba(155, 190,126, 0.2)',
            ],
            borderColor: [
                'rgba(255,99,132,1)',
                'rgba(54, 162, 235, 1)',
                'rgba(255, 206, 86, 1)',
            ],
            borderWidth: 1
        }]
    },
    animation:{
        animateScale:true
    },
    options:{
    	legend: {
    		display: false
    	 }
    }
    
             
  
});

{% if as_view %}
})();
{% else %}
});
{%endif%}
	</script>
</div>
