
function CreateChart(ctx, temp, humidity) {

    const data = {
        datasets: [
            {
                label: "Temperature",
                fill: false,
                borderColor: 'rgb(255, 55, 55)',
                data: temp,
                tension: 0.1
            },
            {
                label: "Humidity",
                fill: false,
                borderColor: 'rgb(55, 55, 255)',
                data: humidity,
                tension: 0.1,
                yAxisID: "humid"                               
            }
        ]
    };

    const config = {
        type: 'line',
        data: data,
        options: { maintainAspectRatio: true }
    };

    return tempChart = new Chart(ctx, config);
}