Q:

Chart stays white with the Google Charts API

Trying to fill a chart which gets its information from another file through a JSON request. But something is broken and I can't figure out what.
Console is clear.
    google.charts.load('current', {packages: ['corechart', 'line']});
    google.charts.setOnLoadCallback(() => {

        var data = new google.visualization.DataTable();
        data.addColumn('number', 'X');
        data.addColumn('number', 'Bitcoin');

        $.getJSON('./data.php', (json) => {
            $.each(json, (key, value) => {
                data.addRows([
                    [new Date(parseInt(value.timestamp)).getHours(), parseFloat(value.price)]
                ]);
            });
        });

        var options = {
            hAxis: {
                title: 'Datum'
            },
            vAxis: {
                title: 'Prijs'
            },
            backgroundColor: '#fff'
        };

        var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
        chart.draw(data, options);
    });

Chart picture

A:

$.getJSON runs asynchronously,
which means the code after $.getJSON runs before $.getJSON is finished.  
so you're drawing a blank chart, then adding rows to the data table.  
try moving the rest of the code inside $.getJSON,
as follows...  
google.charts.load('current', {packages: ['corechart', 'line']});
google.charts.setOnLoadCallback(() => {
    var data = new google.visualization.DataTable();
    data.addColumn('number', 'X');
    data.addColumn('number', 'Bitcoin');

    $.getJSON('./data.php', (json) => {
        $.each(json, (key, value) => {
            data.addRows([
                [new Date(parseInt(value.timestamp)).getHours(), parseFloat(value.price)]
            ]);
        });

        var options = {
            hAxis: {
                title: 'Datum'
            },
            vAxis: {
                title: 'Prijs'
            },
            backgroundColor: '#fff'
        };

        var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
        chart.draw(data, options);
    });
});

