Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="81Radarplots.html"><LINK REL="Next" HREF="812Specifyingtitlesfortheaxisandlegendsfortheplots.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="81Radarplots.html">Previous</A><A HREF="812Specifyingtitlesfortheaxisandlegendsfortheplots.html">Next</A><HR NOSHADE><H3><A NAME="8_1_1">8.1.1 Simple radar plots</A></H3><P> Let's start by creating a very simple radar plot based on 5 datapoints using mostly default values.</P><P> As the first thing you must remember to include the extension modulethat contains the radar plot. "jpgraph_radar.php".</P><P> A very simple radar plot is created by the code<DIV class="phpscript">(File: radarex1.php)<BR><CODE><FONT color="#000000"> <FONT color="#0000BB"><?php<BR></FONT><FONT color="#007700">include (</FONT><FONT color="#DD0000">"../jpgraph.php"</FONT><FONT color="#007700">);<BR>include (</FONT><FONT color="#DD0000">"../jpgraph_radar.php"</FONT><FONTcolor="#007700">);<BR> <BR></FONT><FONT color="#FF8000">// Some data to plot<BR></FONT><FONT color="#0000BB">$data </FONT><FONT color="#007700">= array(</FONT><FONT color="#0000BB">55</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">80</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">46</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">71</FONT><FONTcolor="#007700">,</FONT><FONT color="#0000BB">95</FONT><FONT color="#007700">);<BR> <BR></FONT><FONT color="#FF8000">// Create the graph and the plot<BR></FONT><FONT color="#0000BB">$graph </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">RadarGraph</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">250</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">200</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">"auto"</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$plot </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">RadarPlot</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$data</FONT><FONT color="#007700">);<BR><BR></FONT><FONT color="#FF8000">// Add the plot and display the graph<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Add</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$plot</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Stroke</FONT><FONT color="#007700">();<BR></FONT><FONT color="#0000BB">?></FONT></FONT></CODE></DIV></P><P> and would give the result<DIV class="example"><BR> <A href="exframes/frame_radarex1.html" target="blank"><IMG border="0"HEIGHT="200" src="img/img/img/img/img/img/radarex1.png" WIDTH="250"></A><BR><B>Figure 115:</B> A first very simple radar plot using defaultsettings <A href="exframes/frame_radarex1.html" target="blank">[src]</A> <P></P></DIV></P><P> To change the size and position of the radar graph is similar to thepie plot and you do it by using the methods <A href="../ref/SpiderGraph.html#_SPIDERGRAPH_SETSIZE">SetSize()</A> and <A href="../ref/SpiderGraph.html#_SPIDERGRAPH_SETCENTER">SetCenter()</A></P><P> If you want a filled radar plot you need to specify the fill colorwith the method <A href="../ref/SpiderPlot.html#_SPIDERPLOT_SETFILLCOLOR">SetFillColor()</A> The following example shows these methods in action<DIVclass="example"><BR> <A href="exframes/frame_radarex2.html" target="blank"><IMG border="0"HEIGHT="200" src="img/img/img/img/img/img/radarex2.png" WIDTH="300"></A><BR><B>Figure 116:</B> Changing size, position and adding fill color tothe radar plot. <A href="exframes/frame_radarex2.html" target="blank">[src]</A> <P></P></DIV></P><P></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="81Radarplots.html">Previous</A><A HREF="812Specifyingtitlesfortheaxisandlegendsfortheplots.html">Next</A></BODY></HTML>