<?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;

/* graph/graph_global.html.twig */
class __TwigTemplate_6bf4d4435e4d3fbaa589f95eb8e94983 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/mesodd-layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/layout/mesodd-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("graph.global.title", [], "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 "    ";
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 8
            yield "        <div class=\"card card-default\">
            <div class=\"card-body\">
                ";
            // line 10
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
            yield "
                    <div class=\"form-group row\">
                        <div class=\"col-sm-4\">
                             ";
            // line 13
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "type", [], "any", false, false, false, 13), 'label', ["label_attr" => ["class" => "col-sm-12"]]);
            yield "
                            ";
            // line 14
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "type", [], "any", false, false, false, 14), 'widget');
            yield "
                        </div>
                        <div class=\"col-sm-8\">
                             ";
            // line 17
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 17), 'label', ["label_attr" => ["class" => "col-sm-12"]]);
            yield "
                            ";
            // line 18
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 18), 'widget');
            yield "
                        </div>
                    </div>
                ";
            // line 21
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
            yield "  
            </div>
        </div>
    ";
        }
        // line 25
        yield "    ";
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DDD")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 26
            yield "        <div class=\"card card-default\">
            <div class=\"card-body\">
                ";
            // line 28
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
            yield "
                    <div class=\"form-group row\">
                        <div class=\"col-sm-12\">
                             ";
            // line 31
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 31), 'label', ["label_attr" => ["class" => "col-sm-12"]]);
            yield "
                            ";
            // line 32
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 32), 'widget');
            yield "
                        </div>
                    </div>
                ";
            // line 35
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
            yield "  
            </div>
        </div>
    ";
        }
        // line 39
        yield "    ";
        if ((($tmp = ($context["type"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 40
            yield "    ";
            yield from $this->load("graph/graph_global.html.twig", 40, 1594036916)->unwrap()->yield($context);
            // line 56
            yield "    ";
        }
        // line 57
        yield "
";
        yield from [];
    }

    // line 60
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 61
        yield "    <script>
        \$(function () {
            var barChartData = {
                labels  : ";
        // line 64
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v0 = ($context["barChart"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["labels"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
                datasets: [
                    {
                        backgroundColor     : ";
        // line 67
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v1 = ($context["barChart"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["bgColor"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
                        borderColor         : ";
        // line 68
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v2 = ($context["barChart"] ?? null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["bgColor"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
                        borderWidth         : 1,
                        pointRadius         : false,
                        pointColor          : '#3b8bba',
                        pointStrokeColor    : 'rgba(60,141,188,1)',
                        pointHighlightFill  : '#fff',
                        pointHighlightStroke: 'rgba(60,141,188,1)',
                        data                : ";
        // line 75
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v3 = ($context["barChart"] ?? null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["values"] ?? null) : null));
        } else {
            yield " [] ";
        }
        // line 76
        yield "                    },
                ]
            }

            var barChartCanvas = document.getElementById('barChart').getContext('2d');
      
            var barChartOptions = {
                responsive              : true,
                maintainAspectRatio     : false,
                datasetFill             : false,
                legend: {
                        display: false
                    },
                scales: {
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        }
                    }]
                },
                plugins: {
                    // Change options for ALL labels of THIS CHART
                    datalabels: {
                        backgroundColor: ";
        // line 99
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v4 = ($context["barChart"] ?? null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["bgColor"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
\t\t\t\t\t\tborderColor: 'white',
\t\t\t\t\t\tborderRadius: 25,
\t\t\t\t\t\tborderWidth: 2,
                        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>

    <script src=\"";
        // line 123
        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 124
        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 "graph/graph_global.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  266 => 124,  262 => 123,  231 => 99,  206 => 76,  200 => 75,  186 => 68,  178 => 67,  168 => 64,  163 => 61,  156 => 60,  150 => 57,  147 => 56,  144 => 40,  141 => 39,  134 => 35,  128 => 32,  124 => 31,  118 => 28,  114 => 26,  111 => 25,  104 => 21,  98 => 18,  94 => 17,  88 => 14,  84 => 13,  78 => 10,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

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


/* graph/graph_global.html.twig */
class __TwigTemplate_6bf4d4435e4d3fbaa589f95eb8e94983___1594036916 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_title' => [$this, 'block_box_title'],
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 40
        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", 40);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 41
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 42
        yield "                <label class=\"col-sm-12 col-form-label\"><span style=\"color:red\">Sensibilité globale : ";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber(($context["global"] ?? null), 2, ",", " "), "html", null, true);
        yield " %</span></label>
        ";
        yield from [];
    }

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

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  361 => 45,  354 => 44,  346 => 42,  339 => 41,  328 => 40,  266 => 124,  262 => 123,  231 => 99,  206 => 76,  200 => 75,  186 => 68,  178 => 67,  168 => 64,  163 => 61,  156 => 60,  150 => 57,  147 => 56,  144 => 40,  141 => 39,  134 => 35,  128 => 32,  124 => 31,  118 => 28,  114 => 26,  111 => 25,  104 => 21,  98 => 18,  94 => 17,  88 => 14,  84 => 13,  78 => 10,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

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