| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="91Radarplots.html">
|
|
|
8 |
<LINK REL="Next" HREF="912Specifyingtitlesfortheaxisandlegendsfortheplots.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="91Radarplots.html">Previous</A>
|
|
|
26 |
<A HREF="912Specifyingtitlesfortheaxisandlegendsfortheplots.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="9_1_1">9.1.1 Simple radar plots</A></H3>
|
|
|
29 |
<P> Let's start by creating a very simple radar plot based on 5 data
|
|
|
30 |
points using mostly default values.</P>
|
|
|
31 |
<P> As the first thing you must remember to include the extension module
|
|
|
32 |
that contains the radar plot. "jpgraph_radar.php".</P>
|
|
|
33 |
<P> A very simple radar plot is created by the code<DIV class="phpscript">
|
|
|
34 |
(File: radarex1.php)
|
|
|
35 |
<BR><CODE><FONT color="#000000"> <FONT color="#0000BB"><?php
|
|
|
36 |
<BR></FONT><FONT color="#007700">include (</FONT><FONT color="#DD0000">
|
|
|
37 |
"../jpgraph.php"</FONT><FONT color="#007700">);
|
|
|
38 |
<BR>include (</FONT><FONT color="#DD0000">"../jpgraph_radar.php"</FONT><FONT
|
|
|
39 |
color="#007700">);
|
|
|
40 |
<BR>
|
|
|
41 |
<BR></FONT><FONT color="#FF8000">// Some data to plot
|
|
|
42 |
<BR></FONT><FONT color="#0000BB">$data </FONT><FONT color="#007700">
|
|
|
43 |
= array(</FONT><FONT color="#0000BB">55</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
44 |
color="#0000BB">80</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
45 |
46</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">71</FONT><FONT
|
|
|
46 |
color="#007700">,</FONT><FONT color="#0000BB">95</FONT><FONT color="#007700">
|
|
|
47 |
);
|
|
|
48 |
<BR>
|
|
|
49 |
<BR></FONT><FONT color="#FF8000">// Create the graph and the plot
|
|
|
50 |
<BR></FONT><FONT color="#0000BB">$graph </FONT><FONT color="#007700">
|
|
|
51 |
= new </FONT><FONT color="#0000BB">RadarGraph</FONT><FONT color="#007700">
|
|
|
52 |
(</FONT><FONT color="#0000BB">250</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
53 |
color="#0000BB">200</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
54 |
"auto"</FONT><FONT color="#007700">);
|
|
|
55 |
<BR></FONT><FONT color="#0000BB">$plot </FONT><FONT color="#007700">
|
|
|
56 |
= new </FONT><FONT color="#0000BB">RadarPlot</FONT><FONT color="#007700">
|
|
|
57 |
(</FONT><FONT color="#0000BB">$data</FONT><FONT color="#007700">);
|
|
|
58 |
<BR>
|
|
|
59 |
<BR></FONT><FONT color="#FF8000">// Add the plot and display the graph
|
|
|
60 |
<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
61 |
color="#0000BB">Add</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
62 |
$plot</FONT><FONT color="#007700">);
|
|
|
63 |
<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
64 |
color="#0000BB">Stroke</FONT><FONT color="#007700">();
|
|
|
65 |
<BR></FONT><FONT color="#0000BB">?></FONT></FONT></CODE></DIV></P>
|
|
|
66 |
<P> and would give the result<DIV class="example">
|
|
|
67 |
<BR> <A href="exframes/frame_radarex1.html" target="blank"><IMG border="0"
|
|
|
68 |
HEIGHT="200" src="img/radarex1.png" WIDTH="250"></A>
|
|
|
69 |
<BR><B>Figure 111:</B> A first very simple radar plot using default
|
|
|
70 |
settings <A href="exframes/frame_radarex1.html" target="blank">[src]</A>
|
|
|
71 |
|
|
|
72 |
<P></P>
|
|
|
73 |
</DIV></P>
|
|
|
74 |
<P> To change the size and position of the radar graph is similar to the
|
|
|
75 |
pie plot and you do it by using the methods <A href="../ref/SpiderGraph.html#_SPIDERGRAPH_SETSIZE">
|
|
|
76 |
SetSize()</A> and <A href="../ref/SpiderGraph.html#_SPIDERGRAPH_SETCENTER">
|
|
|
77 |
SetCenter()</A></P>
|
|
|
78 |
<P> If you want a filled radar plot you need to specify the fill color
|
|
|
79 |
with the method <A href="../ref/SpiderPlot.html#_SPIDERPLOT_SETFILLCOLOR">
|
|
|
80 |
SetFillColor()</A> The following example shows these methods in action<DIV
|
|
|
81 |
class="example">
|
|
|
82 |
<BR> <A href="exframes/frame_radarex2.html" target="blank"><IMG border="0"
|
|
|
83 |
HEIGHT="200" src="img/radarex2.png" WIDTH="300"></A>
|
|
|
84 |
<BR><B>Figure 112:</B> Changing size, position and adding fill color to
|
|
|
85 |
the radar plot. <A href="exframes/frame_radarex2.html" target="blank">
|
|
|
86 |
[src]</A>
|
|
|
87 |
<P></P>
|
|
|
88 |
</DIV></P>
|
|
|
89 |
<P></P>
|
|
|
90 |
<HR NOSHADE>
|
|
|
91 |
<A HREF="toc.html">Contents</A>
|
|
|
92 |
<A HREF="91Radarplots.html">Previous</A>
|
|
|
93 |
<A HREF="912Specifyingtitlesfortheaxisandlegendsfortheplots.html">Next</A>
|
|
|
94 |
</BODY>
|
|
|
95 |
</HTML>
|