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

@push('scripts')
    <script type="text/javascript">
        $(document).ready(function () {
            const EChartPocetKontrolPodlaEmisnehoSystemuVozidla = echarts.init(document.getElementById('EChartPocetKontrolPodlaEmisnehoSystemuVozidla'), 'macarons');
            EChartPocetKontrolPodlaEmisnehoSystemuVozidla.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',
                                displayName: 'Technik',
                            },
                            {
                                name: 'D_BKAT_NKAT',
                                type: 'int',
                                displayName: 'D/BKAT, D/NKAT',
                            },
                            {
                                name: 'D_NKAT_OBD',
                                type: 'int',
                                displayName: 'D/NKAT OBD',
                            },
                            {
                                name: 'RKAT',
                                type: 'int',
                                displayName: '*/RKAT',
                            },
                            {
                                name: 'RKAT_OBD',
                                type: 'int',
                                displayName: '*/RKAT OBD',
                            },
                            {
                                name: 'BKAT_NKAT',
                                type: 'int',
                                displayName: '*/BKAT, */NKAT',
                            },
                            {
                                name: 'NEDEFINOVANY',
                                type: 'int',
                                displayName: 'Nedefinovaný',
                            },
                        ],
                        source: @json($PocetKontrolPodlaEmisnehoSystemuVozidlaEChartSource ?? []),
                    },
                ],
                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',
                    },
                    {
                        type: 'bar',
                        stack: 'total',
                    },
                    {
                        type: 'bar',
                        stack: 'total',
                    },
                ],
            });
        });
    </script>
@endpush
