<!-- Modal HTML Markup -->
<html>
    @push('headerScripts')
        <script src="https://code.highcharts.com/highcharts.js" type='text/javascript'></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" type='text/javascript'></script>
    @endpush
    <div id="showHistory" class="modal fade">
        <div class="modal-dialog">
            <div style="position: absolute; float: left; left: 50%; transform: translate(-50%, 10%);">
                <div class="modal-content" style="width: 900px; height: 700px;">
                    <input type="hidden" id="id_stanice_modal" value="0">
                    <div class="modal-header">
                        <h1 class="modal-title">Historie</h1>
                    </div>
                    <div class="modal-body">
                        <div class="card-body">
                            <div id="ovladaniGrafu">

                            </div>
                            <br>
                            <div id="containerDataGraf" style="border: #1b1e21 1px solid; border-radius: 3px;">
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="application/javascript">

        function nastavModal(id)
        {
            $.ajax({
                url: '/'+id+'/dataModalOvladani',
                type: 'GET',
                dataType : 'html',
                data : {id : id},
                success: function(data)
                {
                    $('#ovladaniGrafu').empty();
                    $('#ovladaniGrafu').append(data);
                }
            });

            $.ajax({
                url: '/dataModalOvladani',
                type: 'POST',
                dataType : 'json',
                data : {id : id},
                success: function(data)
                {
                    $('#containerDataGraf').empty();
                    Highcharts.chart('containerDataGraf', data);
                }
            });
        }
    </script>
</html>
