Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Adding upon the example from <a href="https://stackoverflow.com/users/22224/tom-haigh">@Tom Haigh</a>:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;title&gt;Flot Examples&lt;/title&gt; &lt;link href="layout.css" rel="stylesheet" type="text/css"&gt; &lt;!--[if lte IE 8]&gt;&lt;script language="javascript" type="text/javascript" src="../excanvas.min.js"&gt;&lt;/script&gt;&lt;![endif]--&gt; &lt;script language="javascript" type="text/javascript" src="../jquery.js"&gt;&lt;/script&gt; &lt;script language="javascript" type="text/javascript" src="../jquery.flot.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Flot Examples&lt;/h1&gt; &lt;div id="placeholder" style="width:600px;height:300px;"&gt;&lt;/div&gt; &lt;?php $server = "localhost"; $user="user"; $password="password"; $database = "some_database"; $connection = mysql_connect($server,$user,$password); $db = mysql_select_db($database,$connection); query = "SELECT x_axis_values, y_axis_values FROM some_table"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $dataset1[] = array($row['x_axis_value'],$row['y_axis_value']); } ?&gt; &lt;script type="text/javascript"&gt; $(function () { var dataset1 = &lt;?php echo json_encode($dataset1); ?&gt;; $.plot($("#placeholder"), [ dataset1 ]); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload