chamilo/chamilo-lms

View on GitHub
src/CoreBundle/Resources/views/Resource/disk_space.html.twig

Summary

Maintainability
Test Coverage
{% extends "@ChamiloCore/Layout/layout_one_col.html.twig" %}

{% block content %}
    <script>
        $(function() {
            var ctx = document.getElementById('chart').getContext('2d');
            var chart = new Chart(ctx, {
                type: 'pie',
                data: {
                    labels: {{labels|json_encode()|raw}},
                    datasets: [{
                        data:  {{ data|json_encode|raw }},
                        backgroundColor: [
                            'rgba(255, 99, 132, 0.2)',
                            'rgba(54, 162, 235, 0.2)',
                            'rgba(255, 206, 86, 0.2)',
                            'rgba(75, 192, 192, 0.2)',
                            'rgba(153, 102, 255, 0.2)',
                            'rgba(255, 159, 64, 0.2)'
                        ],
                    }],
                },
            });
        });
    </script>
    <div class="box-body" style="width:400px" >
        <canvas id="chart" width="400px" height="400"></canvas>
    </div>
{% endblock %}