<script>
    //ChartJs
    const labels1 = [
        <?php $__currentLoopData = $evaluations1; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $evaluation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            "<?php echo e($evaluation->date); ?> . <?php echo e(str_replace('\'', ' ', $evaluation->matiere->libelle)); ?>",
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    ];

    const data1 = {
        labels: labels1,
        datasets: [{
            label: 'Evolution 1er semestre/trimestre',
            backgroundColor: 'rgb(62,142,208)',
            borderColor: 'rgb(62,142,208)',
            data: [
                <?php $__currentLoopData = $moyennesEvaluations1; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $moyenneEvaluation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php echo e($moyenneEvaluation); ?>,
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            ],
        }]
    };

    const config1 = {
        type: 'line',
        data: data1,
        options: {
            scales: {
                y: { // defining min and max so hiding the dataset does not change scale range
                    min: 0,
                    <?php if($classe->type == 'Primaire'): ?>
                        max: 10
                    <?php else: ?>
                        max: 20
                    <?php endif; ?>

                },
                x: {
                    display: false
                }
            }
        }
    };

    const chartClasse1 = new Chart(
        document.getElementById('chartClasse1'),
        config1
    );

    //
    //ChartJs
    const labels2 = [
        <?php $__currentLoopData = $evaluations2; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $evaluation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            "<?php echo e($evaluation->date); ?> . <?php echo e(str_replace('\'', ' ', $evaluation->matiere->libelle)); ?>",
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    ];

    const data2 = {
        labels: labels2,
        datasets: [{
            label: 'Evolution 2nd semestre/trimestre',
            backgroundColor: 'rgb(62,142,208)',
            borderColor: 'rgb(62,142,208)',
            data: [
                <?php $__currentLoopData = $moyennesEvaluations2; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $moyenneEvaluation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php echo e($moyenneEvaluation); ?>,
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            ],
        }]
    };

    const config2 = {
        type: 'line',
        data: data2,
        options: {
            scales: {
                y: { // defining min and max so hiding the dataset does not change scale range
                    min: 0,
                    <?php if($classe->type == 'Primaire'): ?>
                        max: 10
                    <?php else: ?>
                        max: 20
                    <?php endif; ?>

                },
                x: {
                    display: false
                }
            }
        }
    };

    const chartClasse2 = new Chart(
        document.getElementById('chartClasse2'),
        config2
    );

    //
    //ChartJs
    const labels3 = [
        <?php $__currentLoopData = $evaluations3; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $evaluation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            "<?php echo e($evaluation->date); ?> . <?php echo e(str_replace('\'', ' ', $evaluation->matiere->libelle)); ?>",
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    ];

    const data3 = {
        labels: labels3,
        datasets: [{
            label: 'Evolution 3e trimestre',
            backgroundColor: 'rgb(62,142,208)',
            borderColor: 'rgb(62,142,208)',
            data: [
                <?php $__currentLoopData = $moyennesEvaluations3; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $moyenneEvaluation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php echo e($moyenneEvaluation); ?>,
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            ],
        }]
    };

    const config3 = {
        type: 'line',
        data: data3,
        options: {
            scales: {
                y: { // defining min and max so hiding the dataset does not change scale range
                    min: 0,
                    <?php if($classe->type == 'Primaire'): ?>
                        max: 10
                    <?php else: ?>
                        max: 20
                    <?php endif; ?>

                },
                x: {
                    display: false
                }
            }
        }
    };

    const chartClasse3 = new Chart(
        document.getElementById('chartClasse3'),
        config3
    );
</script>
<?php /**PATH /home/dide1435/luqman.upschool-sn.com/resources/views//partials/classeJs.blade.php ENDPATH**/ ?>