Guys, I really need help, in this case is completely new (
I have a graph that I set the numbers with phpmyadmin , but you need to constantly press F5 . Which script to insert here so that it updates itself + whenever possible, displays random numbers in the graph if you disconnect, for example, from the database (so that you can see that there is a dynamic and something changes on the graph)
DATABASE:
<?php $connect = mysqli_connect("localhost", "root", "a-1800", "testing"); $query = "SELECT * FROM account"; $result = mysqli_query($connect, $query); $chart_data = ''; while($row = mysqli_fetch_array($result)) { $chart_data .= "{ year:'".$row["year"]."', years:'".$row["years"]."', profit:".$row["profit"].", purchase:".$row["purchase"].", sales:".$row["sales"].", sale:".$row["sale"]."}, "; } $chart_data = substr($chart_data, 0, -2); ?> SCHEDULE:
Morris.Bar({ element : 'chart1', data:[<?php echo $chart_data; ?>], xkey:'year', ykeys:['profit', 'purchase', 'sale' , 'sales'], labels:['1 участок', '2 участок', '3 участок', '4 участок'], hideHover:'auto', behaveLikeLine: true, resize:true, gridTextColor: ['black'], gridTextSize: ['15'], barColors: ['#ff6d6d', '#3333ff','#6d6d93','#0e0e31'], });