Location: PHPKode > projects > tgsf > tgsf-0.9.2/tgsf_core/3rd_party/graph/examples-static.html
<html><head>

<style>

	body,h2 {

		font-family:courier new;

		text-align:center;

	}

</style>

<title>Advanced Graphing Class Examples</title>


<script type="text/javascript" src="wz_jsgraphics.js"></script>
</head><body>

<div style="width:100%;background-color:#DD2222;color:#FFFFFF;font-family:arial">The most updated version of this document is available <a href="http://www.zackbloom.org/graph/examples.html" style="color:#CCCCCC">here</a>. You should always use that version if possible.</div>
<script type="text/javascript"><!--

google_ad_client = "pub-4124226543790948";

google_ad_width = 728;

google_ad_height = 90;

google_ad_format = "728x90_as";

google_alternate_ad_url = "http://slashdot.org";

google_ad_type = "text_image";

google_ad_channel ="";

google_color_border = "FFFFFF";

google_color_link = "191919";

google_color_bg = "FFFFFF";

google_color_text = "000000";

google_color_url = "666666";

//--></script>

<script type="text/javascript"

  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>

<h2>Advanced Graphing Class Examples</h2>

<br>

This page is for demonstration purposes only, you should read the <a href="http://www.zackbloom.org/graph/readme.html">readme</a> before trying any of the methods shown.

<br>

All these graphs were generated when this page loaded (assuming your viewing it live), most graphs are generated in under 25ms.  They all have the benchmark property on to allow you to see the graphing speed.  A 360 point graph takes less then 50ms.

<br><br><br>

<table style="text-align:center;width:100%">

<tr><td>

9ms
<img src="images/exa18.png">

<div style="text-align:left">

<code><span style="color: #000000">
<br><span style="color: #0000BB">&lt;?php<br>$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showkey&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//You&nbsp;can&nbsp;also&nbsp;set&nbsp;properties&nbsp;directly<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">type&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"bar"</span><span style="color: #007700">;<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showxgrid&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">colorlist&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">key&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'alpha'</span><span style="color: #007700">,</span><span style="color: #DD0000">'beta'</span><span style="color: #007700">,</span><span style="color: #DD0000">'gamma'</span><span style="color: #007700">,</span><span style="color: #DD0000">'delta'</span><span style="color: #007700">,</span><span style="color: #DD0000">'pi'</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">benchmark&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">keyinfo&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">demoData</span><span style="color: #007700">(</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">'images/exa18.png'</span><span style="color: #007700">);<br></span><span style="color: #0000BB">?&gt;
</span>
</span>
</code></div>

<td>

159ms
<img src="images/exa19.png"><div style="text-align:left">

<code><span style="color: #000000">
<br><span style="color: #0000BB">&lt;?php<br>$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"showkey"</span><span style="color: #007700">,</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"type"</span><span style="color: #007700">,</span><span style="color: #DD0000">"pie"</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"showgrid"</span><span style="color: #007700">,</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"key"</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'alpha'</span><span style="color: #007700">,</span><span style="color: #DD0000">'beta'</span><span style="color: #007700">,</span><span style="color: #DD0000">'gamma'</span><span style="color: #007700">,</span><span style="color: #DD0000">'delta'</span><span style="color: #007700">,</span><span style="color: #DD0000">'pi'</span><span style="color: #007700">));<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"keywidspc"</span><span style="color: #007700">,-</span><span style="color: #0000BB">50</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"benchmark"</span><span style="color: #007700">,</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"keyinfo"</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">demoData</span><span style="color: #007700">(</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">);<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();<br></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">'images/exa19.png'</span><span style="color: #007700">);<br></span><span style="color: #0000BB">?&gt;
</span>
</span>
</code></div>

<tr><td>

190ms<img src="images/exa14.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">()

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">5</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">12</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">7</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">8</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"type"</span><span style="color: #007700">,</span><span style="color: #DD0000">"pie"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"showgrid"</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa14.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

170ms<img src="images/exa15.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">demoData</span><span style="color: #007700">(</span><span style="color: #0000BB">8</span><span style="color: #007700">,</span><span style="color: #0000BB">1000</span><span style="color: #007700">,</span><span style="color: #0000BB">10000</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"type"</span><span style="color: #007700">,</span><span style="color: #DD0000">"pie"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"showgrid"</span><span style="color: #007700">,</span><span style="color: #0000BB">false</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"pieangle"</span><span style="color: #007700">,</span><span style="color: #0000BB">56</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"useval"</span><span style="color: #007700">,</span><span style="color: #0000BB">true</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa15.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

19ms<img src="images/exa12.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">5</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">12</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">7</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">8</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"type"</span><span style="color: #007700">,</span><span style="color: #DD0000">"bar"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"barstyle"</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"barwidth"</span><span style="color: #007700">,</span><span style="color: #0000BB">.8</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">"gstart"</span><span style="color: #007700">,-</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">"blue"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">"gend"</span><span style="color: #007700">,-</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">"black"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa12.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

14ms<img src="images/exa13.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">5</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">12</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">7</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">8</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"type"</span><span style="color: #007700">,</span><span style="color: #DD0000">"bar"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"showxgrid"</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"barwidth"</span><span style="color: #007700">,</span><span style="color: #0000BB">.9</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">"colorlist"</span><span style="color: #007700">,array(array(</span><span style="color: #0000BB">100</span><span style="color: #007700">,</span><span style="color: #0000BB">100</span><span style="color: #007700">,</span><span style="color: #0000BB">255</span><span style="color: #007700">),array(</span><span style="color: #0000BB">150</span><span style="color: #007700">,</span><span style="color: #0000BB">255</span><span style="color: #007700">,</span><span style="color: #0000BB">255</span><span style="color: #007700">),array(</span><span style="color: #0000BB">160</span><span style="color: #007700">,</span><span style="color: #0000BB">255</span><span style="color: #007700">,</span><span style="color: #0000BB">160</span><span style="color: #007700">),array(</span><span style="color: #0000BB">255</span><span style="color: #007700">,</span><span style="color: #0000BB">255</span><span style="color: #007700">,</span><span style="color: #0000BB">150</span><span style="color: #007700">),array(</span><span style="color: #0000BB">255</span><span style="color: #007700">,</span><span style="color: #0000BB">110</span><span style="color: #007700">,</span><span style="color: #0000BB">110</span><span style="color: #007700">)));

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa13.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

23ms<img src="images/exa1.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">3</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">4</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">7</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa1.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

24ms<img src="images/exa2.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">6</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">7</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa2.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

50ms<img src="images/exa3.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">importCSV</span><span style="color: #007700">(</span><span style="color: #DD0000">"testdata2.csv"</span><span style="color: #007700">,</span><span style="color: #DD0000">"i,d"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #DD0000">'red'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setBulkProps</span><span style="color: #007700">(</span><span style="color: #DD0000">'xsclpts:6,xincpts:6,ysclpts:4,yincpts:4'</span><span style="color: #007700">);&nbsp;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'autosize'</span><span style="color: #007700">,</span><span style="color: #0000BB">false</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">yMin&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">yMax&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xMin&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xMax&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">360</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa3.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

37ms<img src="images/exa4.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">6</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">7</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">7</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPoint</span><span style="color: #007700">(</span><span style="color: #0000BB">7</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">20</span><span style="color: #007700">,</span><span style="color: #0000BB">200</span><span style="color: #007700">,</span><span style="color: #0000BB">20</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">'red'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa4.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

23ms<img src="images/exa5.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addBulkPoints</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">4</span><span style="color: #007700">,</span><span style="color: #0000BB">5</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">3</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"http://www.zackbloom.org/graph/exa5.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

30ms<img src="images/exa6.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addBulkPoints</span><span style="color: #007700">(</span><span style="color: #DD0000">"0|1,0|5,0|2,1|4,1|7,1|3"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">'orange'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa6.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

25ms<img src="images/exa7.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addBulkPoints</span><span style="color: #007700">(</span><span style="color: #DD0000">"0|1,0|5,0|2,1|4,1|7,1|3"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setBulkProps</span><span style="color: #007700">(</span><span style="color: #DD0000">"1|endstyle:1,1|pointwidth:20,1|pointstyle:8"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">'orange'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa7.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

33ms<img src="images/exa8.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addBulkPoints</span><span style="color: #007700">(</span><span style="color: #DD0000">"0|2:2,0|3:5,0|9:2,1|4:4,1|7:2,1|3:5,2|5:2,2|6:3,2|4:6"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setBulkProps</span><span style="color: #007700">(</span><span style="color: #DD0000">"1|endstyle:1,1|pointwidth:20,1|pointstyle:8,-1|pointstyle:3,-1|pointwidth:10"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">'orange'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #DD0000">'green'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'pointcolor'</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #DD0000">'yellow'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa8.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

28ms<img src="images/exa11.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">importXML</span><span style="color: #007700">(</span><span style="color: #DD0000">"testdata.xml"</span><span style="color: #007700">,</span><span style="color: #DD0000">"i"</span><span style="color: #007700">,</span><span style="color: #DD0000">"d"</span><span style="color: #007700">,</span><span style="color: #DD0000">"point"</span><span style="color: #007700">,</span><span style="color: #0000BB">"set"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">importCSV</span><span style="color: #007700">(</span><span style="color: #DD0000">"testdata.csv"</span><span style="color: #007700">,</span><span style="color: #DD0000">"d,i"</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">'red'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa11.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

<img src="images/graphexa1.png"><br>

<div style="text-align:left"><code><span style="color: #000000">

&lt;img&nbsp;src="<span style="color: #0000BB">&lt;?=graph</span><span style="color: #007700">::</span><span style="color: #0000BB">createGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">'RAW:1,2,6,2,6,5'</span><span style="color: #007700">)</span><span style="color: #0000BB">?&gt;</span>"&gt;</span>

</code></div><tr><td>

26ms<img src="images/exa9.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">demoData</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'scale'</span><span style="color: #007700">,</span><span style="color: #DD0000">'date'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'startdate'</span><span style="color: #007700">,</span><span style="color: #DD0000">'January&nbsp;2002'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'xincpts'</span><span style="color: #007700">,</span><span style="color: #0000BB">5</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa9.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

55ms<img src="images/exa10.png"><br><div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">demoData</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #DD0000">'orange'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'title'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Programming&nbsp;-&nbsp;Sleep&nbsp;Relation'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'titlesize'</span><span style="color: #007700">,</span><span style="color: #0000BB">18</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'xlabel'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Sleep'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'ylabel'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Programming&nbsp;Ability'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'scale'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'Kinda&nbsp;Tired'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Really&nbsp;Tired'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Very&nbsp;Tired'</span><span style="color: #007700">));

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa10.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

131ms<img src="images/exa16.png"><br><div style="text-align:left"><code><span style="color: #000000">



<br /><span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">(</span><span style="color: #0000BB">400</span><span style="color: #007700">,</span><span style="color: #0000BB">400</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">importCSV</span><span style="color: #007700">(</span><span style="color: #DD0000">"FermatSpiral_a.csv"</span><span style="color: #007700">,</span><span style="color: #DD0000">"i,d"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">importCSV</span><span style="color: #007700">(</span><span style="color: #DD0000">"FermatSpiral_b.csv"</span><span style="color: #007700">,</span><span style="color: #DD0000">"i,d"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #DD0000">'red'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">'color'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #DD0000">'blue'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setBulkProps</span><span style="color: #007700">(</span><span style="color: #DD0000">'xsclpts:6,xincpts:6,ysclpts:6,yincpts:6'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'autosize'</span><span style="color: #007700">,</span><span style="color: #0000BB">false</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'sort'</span><span style="color: #007700">,</span><span style="color: #0000BB">false</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">yMin&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">25</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">yMax&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">25</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xMin&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">25</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xMax&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">25</span><span style="color: #007700">;

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'title'</span><span style="color: #007700">,</span><span style="color: #DD0000">"Example&nbsp;-&nbsp;Fermat's&nbsp;Spiral"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'titlesize'</span><span style="color: #007700">,</span><span style="color: #0000BB">16</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'xlabel'</span><span style="color: #007700">,</span><span style="color: #DD0000">'X'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'ylabel'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Y'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa16.png"</span><span style="color: #007700">);&nbsp;

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><td>

42ms 

<img src="images/exa17.png"><br>

<div style="text-align:left"><code><span style="color: #000000">

<span style="color: #0000BB">&lt;?php

<br />$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'funcinterval'</span><span style="color: #007700">,</span><span style="color: #0000BB">.125</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'benchmark'</span><span style="color: #007700">,</span><span style="color: #0000BB">true</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graphFunction</span><span style="color: #007700">(</span><span style="color: #DD0000">'x^2'</span><span style="color: #007700">,-</span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graphFunction</span><span style="color: #007700">(</span><span style="color: #DD0000">'10sqrt(x)'</span><span style="color: #007700">,-</span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graphFunction</span><span style="color: #007700">(</span><span style="color: #DD0000">'10sin(x)'</span><span style="color: #007700">,-</span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">''</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #DD0000">'red'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProp</span><span style="color: #007700">(</span><span style="color: #DD0000">'title'</span><span style="color: #007700">,</span><span style="color: #DD0000">"Function&nbsp;Graphing"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColor</span><span style="color: #007700">(</span><span style="color: #DD0000">''</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">,</span><span style="color: #DD0000">'green'</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();

<br /></span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">(</span><span style="color: #DD0000">"exa17.png"</span><span style="color: #007700">);

<br /></span><span style="color: #0000BB">?&gt;</span>

</span>

</code></div><tr><td>

<div id="graph" style="position:relative;width:430;height:230;"></div>

<script>function divDraw(){jg.setFont("arial", "12pt", Font.PLAIN);jg.setColor("#505050");jg.setStroke(Stroke.DOTTED);jg.drawLine(40,0,40,200);jg.drawLine(80,0,80,200);jg.drawLine(120,0,120,200);jg.drawLine(160,0,160,200);jg.drawLine(200,0,200,200);jg.drawLine(240,0,240,200);jg.drawLine(280,0,280,200);jg.drawLine(320,0,320,200);jg.drawLine(360,0,360,200);jg.drawLine(0,33,400,33);jg.drawLine(0,67,400,67);jg.drawLine(0,100,400,100);jg.drawLine(0,133,400,133);jg.drawLine(0,167,400,167);jg.drawLine(0,199,399,199);jg.drawLine(399,199,399,0);jg.drawLine(0,200,0,0);jg.drawLine(0,0,400,0);jg.setStroke(1);jg.setFont("DejaVuSans","12px",Font.PLAIN);jg.drawString("0",0,200);jg.drawString("0.9",34,200);jg.drawString("1.8",74,200);jg.drawString("2.7",114,200);jg.drawString("3.6",154,200);jg.drawString("4.5",194,200);jg.drawString("5.4",234,200);jg.drawString("6.3",274,200);jg.drawString("7.2",314,200);jg.drawString("8.1",355,200);jg.drawString("9",396,200);jg.drawString("2",403,191);jg.drawString("2.8",403,167);jg.drawString("3.7",403,133);jg.drawString("4.5",403,100);jg.drawString("5.3",403,67);jg.drawString("6.2",403,33);jg.drawString("7",403,0);jg.setColor("#0000FF");jg.drawLine(0,120,44,160);jg.drawLine(44,160,88,160);jg.drawLine(88,160,133,40);jg.drawLine(133,40,177,120);jg.drawLine(177,120,222,0);jg.drawLine(222,0,266,0);jg.drawLine(266,0,311,200);jg.drawLine(311,200,355,0);jg.drawLine(355,0,400,120);jg.paint();} 
var jg = new jsGraphics('graph');
divDraw()</script>
<div style="text-align:left">

<code><span style="color: #000000">

This&nbsp;example&nbsp;outputs&nbsp;the&nbsp;graph&nbsp;as&nbsp;HTML&nbsp;layers,&nbsp;not&nbsp;using&nbsp;images

&lt;<br>br&gt;<br>
IN&nbsp;THE&nbsp;HEAD&nbsp;OF&nbsp;THE&nbsp;DOCUMENT:
<br>

<span style="color: #0000BB">&lt;?php
<br>
</span><span style="color: #007700">include(</span><span style="color: #DD0000">"graph.oo.php"</span><span style="color: #007700">);<br>

</span><span style="color: #0000BB">$graph&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">graph</span><span style="color: #007700">(</span><span style="color: #0000BB">400</span><span style="color: #007700">,</span><span style="color: #0000BB">200</span><span style="color: #007700">,</span><span style="color: #0000BB">6</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #DD0000">"div"</span><span style="color: #007700">,</span><span style="color: #DD0000">"graphdiv"</span><span style="color: #007700">);<br>


</span><span style="color: #0000BB">?&gt;<br>
</span>
IN&nbsp;THE&nbsp;BODY:
<br>
&lt;div&nbsp;id="graphdiv"&nbsp;style="position:absolute;left:200px"&gt;&lt;/div&gt;<br>

<span style="color: #0000BB">&lt;?php
<br>
$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">demoData</span><span style="color: #007700">();<br>

</span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">graph</span><span style="color: #007700">();<br>


</span><span style="color: #0000BB">$graph</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showGraph</span><span style="color: #007700">();<br>

</span><span style="color: #0000BB">?&gt;
</span>
</span>
</code>
</div>

<td>The JavaScript generated by the left graph:<br>
<textarea style="width:450px;height:350px">
function divDraw(){
	jg.setFont("arial", "12pt", Font.PLAIN);
	jg.setColor("#505050");
	jg.setStroke(Stroke.DOTTED);
	jg.drawLine(40,0,40,200);
	jg.drawLine(80,0,80,200);
	jg.drawLine(120,0,120,200);
	jg.drawLine(160,0,160,200);
	jg.drawLine(200,0,200,200);
	jg.drawLine(240,0,240,200);
	jg.drawLine(280,0,280,200);
	jg.drawLine(320,0,320,200);
	jg.drawLine(360,0,360,200);
	jg.drawLine(0,33,400,33);
	jg.drawLine(0,67,400,67);
	jg.drawLine(0,100,400,100);
	jg.drawLine(0,133,400,133);
	jg.drawLine(0,167,400,167);
	jg.drawLine(0,199,399,199);
	jg.drawLine(399,199,399,0);
	jg.drawLine(0,200,0,0);
	jg.drawLine(0,0,400,0);
	jg.setStroke(1);
	jg.setFont("arial","12px",Font.PLAIN);
	jg.drawString("0",0,200);
	jg.drawString("0.9",34,200);
	jg.drawString("1.8",74,200);
	jg.drawString("2.7",114,200);
	jg.drawString("3.6",154,200);
	jg.drawString("4.5",194,200);
	jg.drawString("5.4",234,200);
	jg.drawString("6.3",274,200);
	jg.drawString("7.2",314,200);
	jg.drawString("8.1",355,200);
	jg.drawString("9",396,200);
	jg.drawString("3",403,191);
	jg.drawString("4.2",403,167);
	jg.drawString("5.3",403,133);
	jg.drawString("6.5",403,100);
	jg.drawString("7.7",403,67);
	jg.drawString("8.8",403,33);
	jg.drawString("10",403,0);
	jg.setColor("#0000FF");
	jg.drawLine(0,200,44,85);
	jg.drawLine(44,85,88,200);
	jg.drawLine(88,200,133,200);
	jg.drawLine(133,200,177,114);
	jg.drawLine(177,114,222,142);
	jg.drawLine(222,142,266,0);
	jg.drawLine(266,0,311,28);
	jg.drawLine(311,28,355,28);
	jg.drawLine(355,28,400,200);
	jg.paint();
} 
var jg = new jsGraphics('graph');
divDraw()
</textarea>

</table>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">

</script>

<script type="text/javascript">

_uacct = "UA-801194-1";

urchinTracker();

</script>

</body></html>
Return current item: tgsf