Are there any tools like MRTG that can generate graphics for temperature data in PHP?

One possible solution to generate graphics for temperature data in PHP is to use a library like Chart.js. Chart.js is a popular JavaScript library that allows you to create interactive and customizable charts and graphs. You can use PHP to fetch the temperature data from a database or API, and then pass that data to Chart.js to generate the graphics.

<!DOCTYPE html>
<html>
<head>
    <title>Temperature Chart</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
    <canvas id="temperatureChart" width="400" height="200"></canvas>

    <?php
    // Fetch temperature data from database or API
    $temperatures = [25, 28, 30, 27, 26, 29]; // Example data

    // Convert temperature data to JSON format for Chart.js
    $temperatureData = json_encode($temperatures);
    ?>

    <script>
        var ctx = document.getElementById('temperatureChart').getContext('2d');
        var temperatures = <?php echo $temperatureData; ?>;

        var myChart = new Chart(ctx, {
            type: 'line',
            data: {
                labels: ['1', '2', '3', '4', '5', '6'],
                datasets: [{
                    label: 'Temperature',
                    data: temperatures,
                    backgroundColor: 'rgba(75, 192, 192, 0.2)',
                    borderColor: 'rgba(75, 192, 192, 1)',
                    borderWidth: 1
                }]
            },
            options: {
                scales: {
                    y: {
                        beginAtZero: true
                    }
                }
            }
        });
    </script>
</body>
</html>