<div id="EChartPocetKontrolPodlaHodnotenia" style="height:400px"></div>

@push('scripts')
    <script type="text/javascript">
        $(document).ready(function () {
            const EChartPocetKontrolPodlaHodnotenia = echarts.init(document.getElementById('EChartPocetKontrolPodlaHodnotenia'), 'macarons');
            EChartPocetKontrolPodlaHodnotenia.setOption({
                backgroundColor: 'transparent',
                grid: {
                    height: 200,
                    width: '90%',
                    left: '5%',
                    right: 1,
                },
                legend: {
                    show: true,
                    type: 'plain',
                    zlevel: 100,
                },
                tooltip: {
                    'trigger': 'item',
                },
                dataset: [
                    {
                        dimensions: [
                            {
                                name: 'label',
                                type: 'ordinal',
                            },
                            {
                                name: 'SPOSOBILE',
                                type: 'number',
                                displayName: 'Spôsobilé',
                            },
                            {
                                name: 'NEHODNOTENE',
                                type: 'number',
                                displayName: 'Nehodnotené',
                            },
                            {
                                name: 'NESPOSOBILE',
                                type: 'number',
                                displayName: 'Nespôsobilé',
                            },
                            {
                                name: 'DOCASNE_SPOSOBILE',
                                type: 'number',
                                displayName: 'Dočasne spôsobilé',
                            },
                            {
                                name: 'pocet',
                                type: 'number',
                            }
                        ],
                        source: @json($PocetKontrolPodlaHodnoteniaEChartSource ?? []),
                    },
                ],
                xAxis: {
                    type: 'category',
                    axisLabel: {
                        rotate: -15,
                        margin: 15,
                        overflow: 'truncate',
                    },
                },
                yAxis: {
                    type: 'value',
                    minInterval: 1,
                },
                series: [
                    {
                        type: 'bar',
                        stack: 'total',
                    },
                    {
                        type: 'bar',
                        stack: 'total',
                    },
                    {
                        type: 'bar',
                        stack: 'total',
                    },
                    {
                        type: 'bar',
                        stack: 'total',
                    },
                ],
            });
        });
    </script>
@endpush
