1 | <?php |
---|
2 | require 'classes/master.php'; //should be at top of every page |
---|
3 | |
---|
4 | if (!isset($_SESSION['userUid'])) { |
---|
5 | redirect("index.php"); |
---|
6 | } |
---|
7 | |
---|
8 | if (isset($_SESSION['message'])) { |
---|
9 | echo $_SESSION['message']; |
---|
10 | unset($_SESSION['message']); |
---|
11 | } |
---|
12 | |
---|
13 | $dbi = new DatabaseInterface(); |
---|
14 | $data = JSON_decode($_POST['selectedData']); |
---|
15 | |
---|
16 | new StyleSheet("visualEditors"); |
---|
17 | |
---|
18 | ?> |
---|
19 | |
---|
20 | <html> |
---|
21 | <head> |
---|
22 | |
---|
23 | <!-- 1/3. Include the RGraph libraries --> |
---|
24 | <script src="RGraph/libraries/RGraph.common.core.js" ></script> |
---|
25 | <script src="RGraph/libraries/RGraph.common.context.js" ></script> |
---|
26 | <script src="RGraph/libraries/RGraph.common.annotate.js" ></script> |
---|
27 | <script src="RGraph/libraries/RGraph.common.tooltips.js" ></script> |
---|
28 | <script src="RGraph/libraries/RGraph.common.zoom.js" ></script> |
---|
29 | <script src="RGraph/libraries/RGraph.radar.js" ></script> |
---|
30 | |
---|
31 | <script> |
---|
32 | window.onload = function () |
---|
33 | { |
---|
34 | if (RGraph.isIE8()) { |
---|
35 | ShowGraph1(); |
---|
36 | ShowGraph2(); |
---|
37 | ShowGraph3(); |
---|
38 | } |
---|
39 | } |
---|
40 | |
---|
41 | function ShowGraph1 () |
---|
42 | { |
---|
43 | var radar1 = new RGraph.Radar('radar5', [43,84,54,64,34,21,21], [52,30,51,41,22,23,56]); |
---|
44 | radar1.Set('chart.colors', ['rgba(255,0,0,0.3)']); |
---|
45 | radar1.Set('chart.labels.axes', 'n'); |
---|
46 | radar1.Set('chart.circle', 50); |
---|
47 | radar1.Set('chart.circle.fill', 'rgba(0, 0, 255, 0.3)'); |
---|
48 | radar1.Set('chart.tooltips', [ |
---|
49 | 'Dave (43)', 'John (84)', 'Kiffen (54)', 'Peter (64)', 'Lou (34)', 'Igor (21)', 'John (21)', |
---|
50 | 'Dave (52)', 'John (30)', 'Kiffen (51)', 'Peter (41)', 'Lou (22)', 'Igor (23)', 'John (56)', |
---|
51 | ]); |
---|
52 | radar1.Set('chart.colors', ['green', 'red']); |
---|
53 | radar1.Set('chart.colors.alpha', 0.5); |
---|
54 | //radar1.Set('chart.title', 'The results of the competition'); |
---|
55 | radar1.Set('chart.labels', ['Dave (43)', 'John (84)', 'Kiffen (54)', 'Peter (64)', 'Lou (34)', 'Igor (21)', 'John (21)']); |
---|
56 | radar1.Set('chart.tooltips.effect', 'fade'); |
---|
57 | radar1.Draw(); |
---|
58 | } |
---|
59 | |
---|
60 | function ShowGraph2 () |
---|
61 | { |
---|
62 | var radar = new RGraph.Radar('radar2', [7,6,6,7,8], [6,7,7,6,6], [4,5,6,10,4]); |
---|
63 | radar.Set('chart.strokestyle', 'black'); |
---|
64 | radar.Set('chart.colors.alpha', 0.3); |
---|
65 | radar.Set('chart.colors', ['red', 'green', 'yellow']); |
---|
66 | //radar.Set('chart.title', 'Multiple datasets, key'); |
---|
67 | radar.Set('chart.tooltips.effect', 'snap'); |
---|
68 | radar.Set('chart.tooltips', [ |
---|
69 | 'Pete in 2000','Lou in 2000','Jim in 2000','Jack in 2000','Fred in 2000', |
---|
70 | 'Pete in 2001','Lou in 2001','Jim in 2001','Jack in 2001','Fred in 2001', |
---|
71 | 'Pete in 2002','Lou in 2002','Jim in 2002','Jack in 2002','Fred in 2002' |
---|
72 | ]); |
---|
73 | radar.Set('chart.key', ['2000','2001','2002']); |
---|
74 | radar.Set('chart.key.position', 'graph'); |
---|
75 | radar.Set('chart.labels', ['Pete','Lou','Jim','Jack','Fred']); |
---|
76 | radar.Set('chart.gutter.top', 35); |
---|
77 | radar.Draw(); |
---|
78 | } |
---|
79 | </script> |
---|
80 | |
---|
81 | </head> |
---|
82 | |
---|
83 | <body> |
---|
84 | |
---|
85 | <!-- 2/3. This is the canvas that the graph is drawn on --> |
---|
86 | <div class="largeFrame"> |
---|
87 | <canvas id="radar5" width="450" height="300">[No canvas support]</canvas> |
---|
88 | <canvas id="radar2" width="450" height="300">[No canvas support]</canvas> |
---|
89 | </div> |
---|
90 | |
---|
91 | <script> |
---|
92 | if (!RGraph.isIE8()) { |
---|
93 | ShowGraph1(); |
---|
94 | ShowGraph2(); |
---|
95 | } |
---|
96 | </script> |
---|
97 | |
---|
98 | |
---|
99 | <div class="smallFrame" id="dataField"> |
---|
100 | <?php |
---|
101 | var_dump($data); |
---|
102 | ?> |
---|
103 | </div> |
---|
104 | |
---|
105 | </body> |
---|
106 | |
---|
107 | </html> |
---|