About Indicator auto refresh

I try to use following indicator to make a chart on webpage.

I use it with MySQL database and php. I have a php file named angularGaugeChart.php. It will display above chart by using “plot.ly” library. When first visit it by browser, it can display the chart correctly. I want to refresh he chart automatically. Thus, I added following script. The php can refresh automatically, but it cannot display the chart after refreshment. I want to know what is the problem in it?

<html>
<head></head>
<body>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

<div id="solarRad" style="width:500px;height:400px;">
<?php 
include 'SQL.php';

mysql_select_db($dbname);

$sqlSolarRad="SELECT * FROM `Test` order by date DESC, time DESC limit 1 ";
$restsqlSolarRad=mysql_query($sqlSolarRad);
while($rowsSqlSolarRad=mysql_fetch_array($restsqlSolarRad))
{
$lastRecordSolarRad= $rowsSqlSolarRad['solarRad'];
}

?>  

<script>
var dataSolarRad = [
  {
    domain: { x: [0, 1], y: [0, 1] },
    value: <?php echo $lastRecordSolarRad ?>,
    title: { text: "Solar Radiation (W/m²)" },
    type: "indicator",
    mode: "gauge+number",
    delta: { reference: 400 },
    gauge: { axis: { range: [null, 1366] } }
  }
];

var layout = { width: 700, height: 400};
Plotly.newPlot('solarRad', dataSolarRad, layout);
</script>
</div>


<script src="jquery-3.4.1.min.js"></script>
<script type="text/javascript">
    document.onload = setupRefresh();
    function setupRefresh()
    {
        setInterval("refreshBlock();",10000);
    }

    function refreshBlock()
    {
       $("#solarRad").load("angularGaugeChart.php #solarRad");
    }
</script>

</body>
</html>