1 | <?php ob_start('ob_gzhandler') ?> |
---|
2 | <!DOCTYPE html> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <meta http-equiv="X-UA-Compatible" content="chrome=1"> |
---|
6 | <!-- |
---|
7 | /** |
---|
8 | * o------------------------------------------------------------------------------o |
---|
9 | * | This file is part of the RGraph package - you can learn more at: | |
---|
10 | * | | |
---|
11 | * | http://www.rgraph.net | |
---|
12 | * | | |
---|
13 | * | This package is licensed under the RGraph license. For all kinds of business | |
---|
14 | * | purposes there is a small one-time licensing fee to pay and for non | |
---|
15 | * | commercial purposes it is free to use. You can read the full license here: | |
---|
16 | * | | |
---|
17 | * | http://www.rgraph.net/LICENSE.txt | |
---|
18 | * o------------------------------------------------------------------------------o |
---|
19 | */ |
---|
20 | --> |
---|
21 | |
---|
22 | <title>RGraph: Javascript charts and graph library - Radar charts</title> |
---|
23 | |
---|
24 | <meta name="keywords" content="rgraph html5 canvas example radar charts" /> |
---|
25 | <meta name="description" content="RGraph: Javascript charts and graph library - Radar charts" /> |
---|
26 | |
---|
27 | <meta property="og:title" content="RGraph: Javascript charts and graph library" /> |
---|
28 | <meta property="og:description" content="A charts library based on the HTML5 canvas tag" /> |
---|
29 | <meta property="og:image" content="http://www.rgraph.net/images/logo.png"/> |
---|
30 | |
---|
31 | <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" /> |
---|
32 | <link rel="icon" type="image/png" href="../images/favicon.png"> |
---|
33 | |
---|
34 | <script src="../libraries/RGraph.common.core.js" ></script> |
---|
35 | <script src="../libraries/RGraph.common.context.js" ></script> |
---|
36 | <script src="../libraries/RGraph.common.annotate.js" ></script> |
---|
37 | <script src="../libraries/RGraph.common.tooltips.js" ></script> |
---|
38 | <script src="../libraries/RGraph.common.zoom.js" ></script> |
---|
39 | <script src="../libraries/RGraph.radar.js" ></script> |
---|
40 | <!--[if IE 8]><script src="../excanvas/excanvas.original.js"></script><![endif]--> |
---|
41 | |
---|
42 | <script> |
---|
43 | window.onload = function () |
---|
44 | { |
---|
45 | if (RGraph.isIE8()) { |
---|
46 | ShowGraph1(); |
---|
47 | ShowGraph2(); |
---|
48 | ShowGraph3(); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | function ShowGraph1 () |
---|
53 | { |
---|
54 | var radar1 = new RGraph.Radar('radar5', [43,84,54,64,34,21,21], [52,30,51,41,22,23,56]); |
---|
55 | radar1.Set('chart.colors', ['rgba(255,0,0,0.3)']); |
---|
56 | radar1.Set('chart.labels.axes', 'n'); |
---|
57 | radar1.Set('chart.circle', 50); |
---|
58 | radar1.Set('chart.circle.fill', 'rgba(0, 0, 255, 0.3)'); |
---|
59 | radar1.Set('chart.tooltips', [ |
---|
60 | 'Dave (43)', 'John (84)', 'Kiffen (54)', 'Peter (64)', 'Lou (34)', 'Igor (21)', 'John (21)', |
---|
61 | 'Dave (52)', 'John (30)', 'Kiffen (51)', 'Peter (41)', 'Lou (22)', 'Igor (23)', 'John (56)', |
---|
62 | ]); |
---|
63 | radar1.Set('chart.colors', ['green', 'red']); |
---|
64 | radar1.Set('chart.colors.alpha', 0.5); |
---|
65 | radar1.Set('chart.title', 'The results of the competition'); |
---|
66 | radar1.Set('chart.labels', ['Dave (43)', 'John (84)', 'Kiffen (54)', 'Peter (64)', 'Lou (34)', 'Igor (21)', 'John (21)']); |
---|
67 | radar1.Set('chart.tooltips.effect', 'fade'); |
---|
68 | radar1.Draw(); |
---|
69 | } |
---|
70 | |
---|
71 | function ShowGraph2 () |
---|
72 | { |
---|
73 | var radar = new RGraph.Radar('radar2', [7,6,6,7,8], [6,7,7,6,6], [4,5,6,10,4]); |
---|
74 | radar.Set('chart.strokestyle', 'black'); |
---|
75 | radar.Set('chart.colors.alpha', 0.3); |
---|
76 | radar.Set('chart.colors', ['red', 'green', 'yellow']); |
---|
77 | radar.Set('chart.title', 'Multiple datasets, key'); |
---|
78 | radar.Set('chart.tooltips.effect', 'snap'); |
---|
79 | radar.Set('chart.tooltips', [ |
---|
80 | 'Pete in 2000','Lou in 2000','Jim in 2000','Jack in 2000','Fred in 2000', |
---|
81 | 'Pete in 2001','Lou in 2001','Jim in 2001','Jack in 2001','Fred in 2001', |
---|
82 | 'Pete in 2002','Lou in 2002','Jim in 2002','Jack in 2002','Fred in 2002' |
---|
83 | ]); |
---|
84 | radar.Set('chart.key', ['2000','2001','2002']); |
---|
85 | radar.Set('chart.key.position', 'graph'); |
---|
86 | radar.Set('chart.labels', ['Pete','Lou','Jim','Jack','Fred']); |
---|
87 | radar.Set('chart.gutter.top', 35); |
---|
88 | radar.Draw(); |
---|
89 | } |
---|
90 | </script> |
---|
91 | |
---|
92 | <script> |
---|
93 | var _gaq = _gaq || []; |
---|
94 | _gaq.push(['_setAccount', 'UA-54706-2']); |
---|
95 | _gaq.push(['_trackPageview']); |
---|
96 | |
---|
97 | (function() { |
---|
98 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
---|
99 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
---|
100 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
---|
101 | })(); |
---|
102 | </script> |
---|
103 | </head> |
---|
104 | <body> |
---|
105 | |
---|
106 | |
---|
107 | <!-- Social networking buttons --> |
---|
108 | <div id="social_icons" class="warning" style="border-radius: 10px; top: 1px; position: fixed"> |
---|
109 | <a title="Bookmark with delicious" href="http://delicious.com/save?jump=close&v=4&noui&jump=close&url=http://www.rgraph.net¬es=RGraph%20is%20a%20HTML5%20based%20javascript%20charts%20library%20supporting%20a%20wide%20range%20of%20different%20charts%20types&title=RGraph:Javascript%20charts%20and%20graphs%20library" target="_blank"><img src="../images/delicious.png" alt="Bookmark with delicious" width="22" height="22" border="0" align="absmiddle" /></a> |
---|
110 | <a href="http://twitter.com/home/?status=RGraph%3A%20Javascript+charts+and+graph+library+http%3A%2F%2Fwww.rgraph.net+%23rgraph+%23html5+%23canvas+%23javascript+%23charts+@_rgraph" target="_blank"><img src="../images/twitter.png" id="twitter_icon" alt="tweet this site" width="22" height="22" border="0" align="absmiddle" /></a> |
---|
111 | </div> |
---|
112 | |
---|
113 | <script> |
---|
114 | // Opera fix |
---|
115 | if (navigator.userAgent.indexOf('Opera') == -1) { |
---|
116 | document.getElementById("social_icons").style.position = 'fixed'; |
---|
117 | } |
---|
118 | </script> |
---|
119 | <!-- Social networking buttons --> |
---|
120 | |
---|
121 | |
---|
122 | <div id="breadcrumb"> |
---|
123 | <a href="../index.html">RGraph: Javascript charts and graph library</a> |
---|
124 | > |
---|
125 | <a href="./index.html">Examples</a> |
---|
126 | > |
---|
127 | Radar charts |
---|
128 | </div> |
---|
129 | |
---|
130 | <h1>RGraph: <span>Javascript charts and graph library</span> - Radar charts</h1> |
---|
131 | |
---|
132 | <div style="background-color: #ffb; border: 2px dashed #000; padding: 3px"> |
---|
133 | This chart used to be called the Tradar chart (T standing for "Traditional" - there used to be two Radar charts in RGraph), |
---|
134 | however now (July 2011), it has been renamed to the "Radar" chart to make it easier for people to identify. If you use it |
---|
135 | you will need to update your code accordingly. Keep in mind that if you use the .type property - this has been updated too |
---|
136 | (to <i>radar</i>). |
---|
137 | </div> |
---|
138 | |
---|
139 | <script> |
---|
140 | if (RGraph.isIE8()) { |
---|
141 | document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer 8 does not natively support the HTML5 canvas tag, so if you want to see the charts, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the RGraph Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag. Click <a href="http://support.rgraph.net/message/rgraph-in-internet-explorer-9.html" target="_blank">here</a> to see some screenshots.</div>'); |
---|
142 | } |
---|
143 | </script> |
---|
144 | |
---|
145 | <div style="float: right; width: 450px"> |
---|
146 | </div> |
---|
147 | |
---|
148 | <p> |
---|
149 | Radar charts, that are similar to Rose charts. Each of the data points is |
---|
150 | arranged equally in terms of angle, whilst the magnitude of each point is shown by the distance from the centre. Thus, |
---|
151 | data points of a higher magnitude can be seen as they are more distant from the centre. |
---|
152 | </p> |
---|
153 | |
---|
154 | <p> |
---|
155 | Suitable for many datasets, but not all. If not, then Rose charts may be more apt. |
---|
156 | </p> |
---|
157 | |
---|
158 | <p> |
---|
159 | The circle, as can be seen in the second example, could be used to indicate a threshold of sorts. In the example, |
---|
160 | it could be minimum sales required for a particular month. Months that fall below this threshold can be clearly seen. |
---|
161 | </p> |
---|
162 | |
---|
163 | <div> |
---|
164 | <ul> |
---|
165 | <li><a href="../docs/radar.html">Radar charts API documentation</a></li> |
---|
166 | <li><a href="rose.html">Rose charts examples</a></li> |
---|
167 | </ul> |
---|
168 | </div> |
---|
169 | |
---|
170 | <div> |
---|
171 | <canvas id="radar2" width="450" height="300">[No canvas support]</canvas> |
---|
172 | <canvas id="radar5" width="450" height="300">[No canvas support]</canvas> |
---|
173 | </div> |
---|
174 | |
---|
175 | |
---|
176 | |
---|
177 | <script> |
---|
178 | if (!RGraph.isIE8()) { |
---|
179 | ShowGraph1(); |
---|
180 | ShowGraph2(); |
---|
181 | } |
---|
182 | </script> |
---|
183 | |
---|
184 | </body> |
---|
185 | </html> |
---|