嗨,我正在尝试从
mysql数据库检索数据以创建虚拟图
任何人都可以通过这个程序走走,或者给我一个想法
谢谢
你可能想要这样的东西.我没有用过,但是我看了这个例子
here.
<?php //create array of pairs of x and y values $dataset1 = array(); while ($row = mysql_fetch_assoc()) { //or whatever $dataset1[] = array( $row['xvalue'],$row['yvalue'] ); } ?> <script type="text/javascript"> //put array into javascript variable var dataset1 = <?php echo json_encode($dataset1); ?>; //plot $(function () { $.plot($("#placeholder"),[ dataset1 ]); }); </script>