<div style="text-align: center; margin: 0 auto; width: 90%; ">
    <canvas id="myChart"></canvas>
</div>
<script src="vendor/nnnick/chartjs/dist/Chart.js"></script>
<script>


    var config = {
        type: 'line',
        data: {
            labels: {{ label | json_encode | raw}},
            datasets: [{
                label: 'Stan',
                borderColor: 'rgba(255, 99, 132, 1)',
                backgroundColor: 'rgba(255, 99, 132, 1)',
                data: {{ stan | json_encode | raw}},
                fill: false,
            }, {
                label: 'Sprzedaż',
                borderColor: 'rgba(54, 162, 235, 1)',
                backgroundColor: 'rgba(54, 162, 235, 1)',
                fill: 'false',
                data: {{ sprzedaz | json_encode | raw}},
            }]
        },
        options: {
            responsive: true,
            title: {
                display: true,
                text: 'Stan i sprzedaż'
            },
            tooltips: {
                mode: 'index',
                intersect: false,
            },
            hover: {
                mode: 'nearest',
                intersect: true
            },
            scales: {
                xAxes: [{
                    display: true,
                    scaleLabel: {
                        display: true,
                        labelString: 'Data'
                    }
                }],
                yAxes: [{
                    display: true,
                    scaleLabel: {
                        display: true,
                        labelString: 'Sztuk'
                    }
                }]
            }
        }
    };

    window.onload = function() {
        var ctx = document.getElementById('myChart');
        window.myLine = new Chart(ctx, config);
    };
</script>