<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;

/* communes/graphdepartementcommune.html.twig */
class __TwigTemplate_6032e8f9a0d36513b3d1329522c67945 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'page_title' => [$this, 'block_page_title'],
            'page_content' => [$this, 'block_page_content'],
            'javascripts' => [$this, 'block_javascripts'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "@AdminLTE/layout/ddd-layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/layout/ddd-layout.html.twig", 1);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Graphiques par commune", [], "messages");
        yield from [];
    }

    // line 6
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 7
        yield "
";
        // line 8
        yield from $this->load("communes/graphdepartementcommune.html.twig", 8, 697988597)->unwrap()->yield($context);
        // line 15
        yield "
";
        // line 16
        if ((($tmp = ($context["commune"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 17
            yield from $this->load("communes/graphdepartementcommune.html.twig", 17, 1538286652)->unwrap()->yield($context);
            // line 28
            yield "
";
            // line 29
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(($context["indicators"] ?? null));
            $context['loop'] = [
              'parent' => $context['_parent'],
              'index0' => 0,
              'index'  => 1,
              'first'  => true,
            ];
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["indicator"]) {
                // line 30
                yield from $this->load("communes/graphdepartementcommune.html.twig", 30, 1700236967)->unwrap()->yield($context);
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['indicator'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 42
            yield "
";
        }
        // line 44
        yield "    
";
        yield from [];
    }

    // line 49
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 50
        yield "    ";
        if ((($tmp = ($context["commune"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 51
            yield "    <script>
        \$(function () {
            var barChartData = {
                labels  : ";
            // line 54
            if ((($tmp = ($context["data1"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield json_encode((($_v0 = ($context["data1"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["labels"] ?? null) : null));
            }
            yield ",
                datasets: [
                    {
                        label               : 'Valeur des indicateurs renseignables',
                        backgroundColor     : 'blue',
                        borderColor         : 'blue',
                        borderWidth         : 1,
                        maxBarThickness     : 75,
                        pointRadius         : false,
                        pointColor          : '#3b8bba',
                        pointStrokeColor    : 'rgba(60,141,188,1)',
                        pointHighlightFill  : '#fff',
                        pointHighlightStroke: 'rgba(60,141,188,1)',
                        data                : ";
            // line 67
            if ((($tmp = ($context["data1"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield json_encode((($_v1 = ($context["data1"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["values"] ?? null) : null));
            }
            // line 68
            yield "                    },
                ]
            }

            var barChartCanvas = document.getElementById('barChart').getContext('2d');
      
            var barChartOptions = {
                responsive              : true,
                maintainAspectRatio     : false,
                datasetFill             : false,
                scales: {
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        }
                    }]
                },
                plugins: {
                    // Change options for ALL labels of THIS CHART
                    datalabels: {
                        color: 'white',
                        font: {
                            weight: 'bold',
                            size: 12,
                        },
                        align: 'start',
\t\t\t\t\t\tanchor: 'end'
                    }
                }
            }
        
            var barChart = new Chart(barChartCanvas, {
                type: 'bar', 
                data: barChartData,
                options: barChartOptions
            })
      
        })
    </script>

";
            // line 108
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(($context["indicators"] ?? null));
            foreach ($context['_seq'] as $context["_key"] => $context["indicator"]) {
                // line 109
                yield "
    <script>
        \$(function () {
            var barChartData";
                // line 112
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 112), "html", null, true);
                yield " = {
                labels  : ";
                // line 113
                if ((($tmp = (($_v2 = ($context["data2"] ?? null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2[CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 113)] ?? null) : null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                    yield json_encode((($_v3 = (($_v4 = ($context["data2"] ?? null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4[CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 113)] ?? null) : null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["labels"] ?? null) : null));
                }
                yield ",
                datasets: [
                    {
                        label               : '";
                // line 116
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_name", [], "any", false, false, false, 116), "html", null, true);
                yield "',
                        backgroundColor     : 'green',
                        borderColor         : 'green',
                        borderWidth         : 1,
                        maxBarThickness     : 75,
                        pointRadius         : false,
                        pointColor          : '#3b8bba',
                        pointStrokeColor    : 'rgba(60,141,188,1)',
                        pointHighlightFill  : '#fff',
                        pointHighlightStroke: 'rgba(60,141,188,1)',
                        data                : ";
                // line 126
                if ((($tmp = (($_v5 = ($context["data2"] ?? null)) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5[CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 126)] ?? null) : null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                    yield json_encode((($_v6 = (($_v7 = ($context["data2"] ?? null)) && is_array($_v7) || $_v7 instanceof ArrayAccess ? ($_v7[CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 126)] ?? null) : null)) && is_array($_v6) || $_v6 instanceof ArrayAccess ? ($_v6["values"] ?? null) : null));
                }
                // line 127
                yield "                    },
                ]
            }

            var barChartCanvas";
                // line 131
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 131), "html", null, true);
                yield " = document.getElementById('barChart";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 131), "html", null, true);
                yield "').getContext('2d');
      
            var barChartOptions";
                // line 133
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 133), "html", null, true);
                yield " = {
                responsive              : true,
                maintainAspectRatio     : false,
                datasetFill             : false,
                scales: {
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        }
                    }]
                },
                plugins: {
                    // Change options for ALL labels of THIS CHART
                    datalabels: {
                        color: 'white',
                        font: {
                            weight: 'bold',
                            size: 12,
                        },
                        align: 'start',
\t\t\t\t\t\tanchor: 'end'
                    }
                }
            }
        
            var barChart";
                // line 158
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 158), "html", null, true);
                yield " = new Chart(barChartCanvas";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 158), "html", null, true);
                yield ", {
                type: 'bar', 
                data: barChartData";
                // line 160
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 160), "html", null, true);
                yield ",
                options: barChartOptions";
                // line 161
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "i_id", [], "any", false, false, false, 161), "html", null, true);
                yield "
            })
      
        })
    </script>
";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['indicator'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
        }
        // line 168
        yield "
    <script src=\"";
        // line 169
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/chart.js/Chart.min.js"), "html", null, true);
        yield "\"></script>
    <script src=\"";
        // line 170
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/chartjs-plugin-datalabels/chartjs-plugin-datalabels.min.js"), "html", null, true);
        yield "\"></script>    
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "communes/graphdepartementcommune.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  316 => 170,  312 => 169,  309 => 168,  296 => 161,  292 => 160,  285 => 158,  257 => 133,  250 => 131,  244 => 127,  240 => 126,  227 => 116,  219 => 113,  215 => 112,  210 => 109,  206 => 108,  164 => 68,  160 => 67,  142 => 54,  137 => 51,  134 => 50,  127 => 49,  121 => 44,  117 => 42,  103 => 30,  86 => 29,  83 => 28,  81 => 17,  79 => 16,  76 => 15,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "communes/graphdepartementcommune.html.twig", "/var/www/html/templates/communes/graphdepartementcommune.html.twig");
    }
}


/* communes/graphdepartementcommune.html.twig */
class __TwigTemplate_6032e8f9a0d36513b3d1329522c67945___697988597 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 8
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 8);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 9
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 10
        yield "            ";
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
        yield "
                ";
        // line 11
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(($context["form"] ?? null), 'widget');
        yield "
            ";
        // line 12
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
        yield "    
        ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "communes/graphdepartementcommune.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  403 => 12,  399 => 11,  394 => 10,  387 => 9,  376 => 8,  316 => 170,  312 => 169,  309 => 168,  296 => 161,  292 => 160,  285 => 158,  257 => 133,  250 => 131,  244 => 127,  240 => 126,  227 => 116,  219 => 113,  215 => 112,  210 => 109,  206 => 108,  164 => 68,  160 => 67,  142 => 54,  137 => 51,  134 => 50,  127 => 49,  121 => 44,  117 => 42,  103 => 30,  86 => 29,  83 => 28,  81 => 17,  79 => 16,  76 => 15,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "communes/graphdepartementcommune.html.twig", "/var/www/html/templates/communes/graphdepartementcommune.html.twig");
    }
}


/* communes/graphdepartementcommune.html.twig */
class __TwigTemplate_6032e8f9a0d36513b3d1329522c67945___1538286652 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 17
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 17);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 18
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 19
        yield "            <div class=\"row\">
                <div class=\"chart\" style=\"position: relative; height:60vh; width:100%\">
                    <canvas id=\"barChart\"></canvas>
                    <!--canvas id=\"myChart\" width=\"400\" height=\"400\"></canvas-->
                    <div id=\"bar-chart\" style=\"height: 100%;\"></div>
                </div>
            </div>
        ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "communes/graphdepartementcommune.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  481 => 19,  474 => 18,  463 => 17,  403 => 12,  399 => 11,  394 => 10,  387 => 9,  376 => 8,  316 => 170,  312 => 169,  309 => 168,  296 => 161,  292 => 160,  285 => 158,  257 => 133,  250 => 131,  244 => 127,  240 => 126,  227 => 116,  219 => 113,  215 => 112,  210 => 109,  206 => 108,  164 => 68,  160 => 67,  142 => 54,  137 => 51,  134 => 50,  127 => 49,  121 => 44,  117 => 42,  103 => 30,  86 => 29,  83 => 28,  81 => 17,  79 => 16,  76 => 15,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "communes/graphdepartementcommune.html.twig", "/var/www/html/templates/communes/graphdepartementcommune.html.twig");
    }
}


/* communes/graphdepartementcommune.html.twig */
class __TwigTemplate_6032e8f9a0d36513b3d1329522c67945___1700236967 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 30
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 30);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 31
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 32
        yield "            <div class=\"row\">
                <div class=\"chart\" style=\"position: relative; height:60vh; width:100%\">
                    <canvas id=\"barChart";
        // line 34
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["indicator"] ?? null), "i_id", [], "any", false, false, false, 34), "html", null, true);
        yield "\"></canvas>
                    <!--canvas id=\"myChart\" width=\"400\" height=\"400\"></canvas-->
                    <div id=\"bar-chart";
        // line 36
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["indicator"] ?? null), "i_id", [], "any", false, false, false, 36), "html", null, true);
        yield "\" style=\"height: 100%;\"></div>
                </div>
            </div>
        ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "communes/graphdepartementcommune.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  573 => 36,  568 => 34,  564 => 32,  557 => 31,  546 => 30,  481 => 19,  474 => 18,  463 => 17,  403 => 12,  399 => 11,  394 => 10,  387 => 9,  376 => 8,  316 => 170,  312 => 169,  309 => 168,  296 => 161,  292 => 160,  285 => 158,  257 => 133,  250 => 131,  244 => 127,  240 => 126,  227 => 116,  219 => 113,  215 => 112,  210 => 109,  206 => 108,  164 => 68,  160 => 67,  142 => 54,  137 => 51,  134 => 50,  127 => 49,  121 => 44,  117 => 42,  103 => 30,  86 => 29,  83 => 28,  81 => 17,  79 => 16,  76 => 15,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "communes/graphdepartementcommune.html.twig", "/var/www/html/templates/communes/graphdepartementcommune.html.twig");
    }
}
