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

@push('scripts')
    <script type="text/javascript">
        $(document).ready(function () {
            const EChartPocetKontrolPodlaKategorieVozidla = echarts.init(document.getElementById('EChartPocetKontrolPodlaKategorieVozidla'), 'macarons');
            EChartPocetKontrolPodlaKategorieVozidla.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: 'M1_N1',
                                type: 'ordinal',
                                displayName: 'M1, N1'
                            },
                            {
                                name: 'M2_M3',
                                type: 'ordinal',
                                displayName: 'M2, M3'
                            },
                            {
                                name: 'N2_N3',
                                type: 'ordinal',
                                displayName: 'N2, N3'
                            },
                            {
                                name: 'T',
                                type: 'ordinal',
                                displayName: 'T'
                            },
                            {
                                name: 'pocet',
                                type: 'number',
                            }
                        ],
                        source: @json($PocetKontrolPodlaKategorieVozidlaEChartSource ?? []),
                    },
                ],
                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
