var pointt =
    '[{"x":1,"y":8},{"x":2,"y":-8},{"x":3,"y":8},{"x":4,"y":-8},{"x":5,"y":8},{"x":6,"y":-8},{"x":7,"y":-4},{"x":8,"y":4},{"x":9,"y":-4},{"x":10,"y":4},{"x":11,"y":-4}]';
var xxx = JSON.parse(pointt);

var items = [];

var color = Chart.helpers.color;

var config = {
    type: "line",
    data: {
        datasets: [
        {
            label: "График",

            borderColor: window.chartColors.red,
            fill: false,
            data: xxx
        }]
    },
    options: {
        responsive: true,
        title: {
            display: true

        },
        scales: {
            xAxes: [{
                type: "time",
                display: true,
                scaleLabel: {
                    display: true,
                    labelString: "Время"
                }
            }],
            yAxes: [{
                display: true,
                scaleLabel: {
                    display: true,
                    labelString: "ИВЛ(ml)"
                }
            }]
        }
    }
};

function sa() {


    $.getJSON("j.json", function (json) {

        $.each(json, function (key, val) {

            items.push(val);
        });

    });

}

function sleep(miliseconds) {
    var currentTime = new Date().getTime();

    while (currentTime + miliseconds >= new Date().getTime()) {
    }
}

window.onload = function () {

    sa();
    
    

    var ctx = document.getElementById("canvas").getContext("2d");
    window.myLine = new Chart(ctx, config);

};








