- Timestamp:
- 01/12/12 17:30:32 (13 years ago)
- Location:
- Dev/branches/Cartis
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/Cartis/classes/dbDataSelectionWidget.php
r202 r227 17 17 public $sessions; 18 18 public $gamedata; 19 20 // toegevoegd questions 21 public $questions; 22 19 23 20 24 public function __construct() { … … 23 27 $this->sessions = $dbi->get("Session", array()); 24 28 $this->gamedata = $dbi->get("Application", array()); 29 30 // toegevoegd questions 31 $this->questions = $dbi->get("Question", array()); 25 32 } 26 33 -
Dev/branches/Cartis/css/visualeditors.css
r204 r227 488 488 height: 415px; 489 489 } 490 491 .graphSelectionButton { 492 width: 75px; 493 height: 50px; 494 background: rgba(255,255,255,0.5); 495 border: 1px solid #FFF; 496 float: left; 497 margin: 0 5px; 498 padding: 2px; 499 } -
Dev/branches/Cartis/dashboardDataSelection.php
r204 r227 38 38 <div class="largeTitle">Instance data</div> 39 39 <select id="dbSessionInstancesList" multiple class="dbDataList" size="15" onchange="infoPanelTimeout(event);"> 40 40 41 <?php 41 foreach ($dbDataSelectionWidget->sessions as $session) { 42 // Fill list 43 // First checkbox, then descriptor 44 echo "<option value='$session->uid'>$session->title</option>"; 45 } 42 43 //Changed sessions into questions 44 // foreach ($dbDataSelectionWidget->survey as $question) { 45 foreach ($dbDataSelectionWidget->sessions as $session) { 46 // Fill list 47 // First checkbox, then descriptor 48 echo "<option value='$session->uid'>$session->title</option>"; 49 } 50 51 46 52 ?> 47 53 </select> … … 78 84 <div id="rightColumn"> 79 85 <div class="largeFrame Cv" id="dbShoppingCart"> 80 <div class="largeTitle">S hopping cart</div>86 <div class="largeTitle">Selected data</div> 81 87 <div class="content" id="shoppingCartContent"> 82 88 -
Dev/branches/Cartis/dashboardGraphSelection.php
r214 r227 8 8 9 9 $dbDataSelectionWidget = new dbDataSelectionWidget(); 10 11 10 $data = JSON_decode($_POST['selectedData']); 12 11 ?> … … 17 16 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 18 17 18 <script type="text/javascript" src="js/generalScripts.js"></script> 19 <script type="text/javascript" src="js/dashboardScripts.js"></script> 20 <script src="RGraph/libraries/RGraph.common.core.js" ></script> 21 <script src="RGraph/libraries/RGraph.common.annotate.js" ></script> 22 <script src="RGraph/libraries/RGraph.common.context.js" ></script> 23 24 <script src="RGraph/libraries/RGraph.common.tooltips.js" ></script> 25 <script src="RGraph/libraries/RGraph.common.resizing.js" ></script> 26 <script src="RGraph/libraries/RGraph.bar.js" ></script> 27 <script src="RGraph/libraries/RGraph.pie.js" ></script> 28 29 <script> 30 myGraph.Set('chart.contextmenu', [ 31 ['Get PNG', RGraph.showPNG], 32 null, 33 ['Cancel', function () {}] 34 ]); 35 </script> 36 37 38 <script> 39 window.onload = function () 40 { 41 42 var bar1 = new RGraph.Bar('chart1', mockupData.muData3); 43 //bar1.Set('chart.background.barcolor1', 'white'); 44 // bar1.Set('chart.background.barcolor2', 'white'); 45 bar1.Set('chart.labels', ['1st', '2nd', '3rd', '4th', '5th', '6th']); 46 bar1.Set('chart.key', ['John', 'Bob']); 47 bar1.Set('chart.key.position.y', 35); 48 bar1.Set('chart.key.position', 'gutter'); 49 bar1.Set('chart.key.background', 'rgb(255,255,255)'); 50 bar1.Set('chart.colors', ['#77f', '#7f7']); 51 bar1.Set('chart.shadow', true); 52 bar1.Set('chart.shadow.blur', 15); 53 bar1.Set('chart.shadow.offsetx', 0); 54 bar1.Set('chart.shadow.offsety', 0); 55 bar1.Set('chart.shadow.color', '#aaa'); 56 bar1.Set('chart.yaxispos', 'right'); 57 bar1.Set('chart.strokestyle', 'rgba(0,0,0,0)'); 58 bar1.Set('chart.gutter.left', 5); 59 bar1.Set('chart.gutter.right', 45); 60 bar1.Draw(); 61 62 63 64 if (!RGraph.isIE8()) { 65 tooltipFunc = function (i) 66 { 67 var r = i % 4; 68 69 if (r == 3) return 'John' 70 else if (r == 2) return 'Rich'; 71 else if (r == 1) return 'Jane'; 72 else if (r == 0) return 'Quentin'; 73 } 74 bar2.Set('chart.tooltips', tooltipFunc); 75 } 76 77 bar2.Draw(); 78 79 } 80 </script> 81 19 82 <title> 20 83 Dashboard Graph Selection … … 23 86 24 87 </head> 25 88 26 89 <body> 27 90 <div id="header"> … … 39 102 <div class="largeTitle">Selected data</div> 40 103 <div class="content" style="width: 300px; height: 500px; "> 104 41 105 <?php 42 106 print_r($data); 43 ?> 107 ?> 108 44 109 </div> 45 46 </div>47 </div>48 49 <div id="rightColumn">50 <div class="largeFrame Cv" style="width: 600px; height: 400px;">51 <div class="largeTitle">Graph selection</div>52 <div class="content">53 <img src="images/icons/nyan.gif" width="595" height="370"></img>54 </div>55 56 </div>57 </div>58 59 60 <div class="largeFrame Cu" id="dbInfoPanel" style="width: 930px;">61 <div class='largeTitle'>Info panel</div>62 <div class="content" id="dbInfoPanelContent" style="height: 100px;">63 110 64 111 </div> … … 66 113 </div> 67 114 115 <div id="rightColumn"> 116 <div class="largeFrame Cv" style="width: 600px; height: 400px;"> 117 <div class="largeTitle">Graph selection</div> 118 <div class="topControls" id="graphTypeSelector" style="float: left; clear: left; width: 100%; margin: 0; border: 1px solid #000;"> 119 <div id="btnSelectPieType" class="graphSelectionButton" onclick="changeGraphType('pie')">PIE CHART</div> 120 <div id="btnSelectBarType" class="graphSelectionButton" onclick="changeGraphType('bar')">BAR CHART</div> 121 <div id="btnSelectRadarType" class="graphSelectionButton" onclick="changeGraphType('radar')">RADAR CHART</div> 122 </div> 123 <div class="content" id="graphDisplay"> 68 124 69 </body> 70 </html> 125 <canvas id="chart1" width="450" height="200" onclick="RGraph.showPNG(document.getElementById('bar1'));">[No canvas support] </canvas> 126 127 <!-- Button to gotoDashboard?? --> 128 129 </div> 130 131 <div class="controls"> 132 <input type="button" class="smallButton" value="Save to dashboard" onClick="addToDashboard()"></input> 133 <input type="button" class="smallButton" value="Go to Dashboard" onClick="gotoDashboard()"></input> 134 135 </div> 136 137 </div> 138 </div> 139 140 141 <div class="largeFrame Cu" id="dbInfoPanel" style="width: 930px;"> 142 <div class='largeTitle'>Info panel</div> 143 <div class="content" id="dbInfoPanelContent" style="height: 100px;"> 144 145 </div> 146 147 148 </div> 149 </div> 150 151 152 153 </body> 154 </html> -
Dev/branches/Cartis/js/dashboardScripts.js
r213 r227 1 1 dbSelectionInfoTimeout = null; 2 currentlySelected = {2 var currentlySelected = { 3 3 titles: [], 4 4 uids: [], … … 6 6 } 7 7 8 shoppingCart = {8 var shoppingCart = { 9 9 contents: { 10 10 titles: [], … … 12 12 types: [] 13 13 } 14 } 15 16 var graphSelection = { 17 graphType: null, 18 graphData: null, 19 dataAvailable: false 20 } 21 22 var mockupData = { 23 muData1: [1,2,3,4,5,6], //pie charts 24 muData2: [[1,2,3],[4,5,6]], //bar charts 25 muData3: [[1,2],[3,4],[5,6]] //radar charts 14 26 } 15 27 … … 143 155 // Lastly, refresh 144 156 drawShoppingCart(); 145 157 } 146 158 147 159 function drawShoppingCart() { 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 160 var scElement = ge("shoppingCartContent"); 161 scElement.innerHTML = ""; 162 for (var i = 0; i < shoppingCart.contents.uids.length; i++) { 163 var newLine = ce("div"); 164 newLine.className = "shoppingCartItem"; 165 newLine.id = "shoppingCartItem"+shoppingCart.contents.uids[i]; 166 var icon = ce("image"); 167 icon.src = "images/ui/DeleteIcon.gif"; 168 icon.addEventListener("click", function(event){ 169 // TODO: Actually write this function 170 removeFromList(event); 171 }, false); 172 var titleField = ce("text"); 173 titleField.innerHTML = shoppingCart.contents.titles[i]; 174 newLine.appendChild(icon); 175 newLine.appendChild(titleField); 176 scElement.appendChild(newLine); 177 } 178 179 // reset type after empty 180 currentlySelected.type = null; 181 } 170 182 171 183 function configureDashboard() { … … 182 194 form.submit(); 183 195 } 196 197 //function goto dashboard 198 function gotoDashboard() { 199 var data = JSON.stringify(doorstuurData); 200 var form = ce("form"); 201 //changed to dashboardGraphSelection.php 202 form.action = "dashboardOverview.php"; 203 form.method = "POST"; 204 var input = ce("input"); 205 input.type = "hidden"; 206 input.name = "doorstuurData"; 207 input.value = data; 208 form.appendChild(input); 209 form.submit(); 210 } 211 212 function changeGraphType(type) { 213 // If different graph type, clear canvas 1. 214 215 switch (type.toLowerCase()){ 216 case "bar": 217 graphSelection.graphType = "Bar"; 218 break; 219 case "radar": 220 graphSelection.graphType = "Radar"; 221 break 222 case "pie": 223 graphSelection.graphType = "Pie"; 224 break; 225 default: 226 break; 227 } 228 229 //alert("Graph type is now: "+graphSelection.graphType); 230 var data = formatGraphData(); 231 drawGraph('chart1', 450, 200, graphSelection.graphType, data); 232 } 233 234 function formatGraphData() { 235 /* 236 * if (data.available == false) { 237 * graphSelection.dataAvailable = false; 238 * insertStandardPlaceholderData(); 239 * } 240 * else { 241 * FormatDataCorrectly(); 242 * } 243 */ 244 // temporary!!!; 245 graphSelection.graphData = mockupData.muData1; 246 return mockupData.muData1; 247 248 //alert("Data is now being formatted"); 249 } 250 251 function drawGraph(name, sizeX, sizeY, type, data) { 252 //delete old graph 253 254 var oldGraph = ge("chart1"); 255 if (oldGraph) oldGraph.parentNode.removeChild(oldGraph); 256 257 var canvas = ce("canvas"); 258 canvas.id = name; 259 canvas.width = sizeX; 260 canvas.height = sizeY; 261 var parentElement = ge("graphDisplay"); 262 parentElement.appendChild(canvas); 263 264 //js calls 265 var chart1; 266 switch (type) { 267 case "Bar": 268 chart1 = new RGraph.Bar(name, data); 269 break; 270 case "Pie": 271 chart1 = new RGraph.Pie(name, data); 272 break; 273 case "Radar": 274 //chart1 = new RGraph.Radar('chart1', graphSelection.graphData); 275 break; 276 default: 277 break; 278 } 279 280 //chart1.Set('chart.background.barcolor1', 'white'); 281 // chart1.Set('chart.background.barcolor2', 'white'); 282 chart1.Set('chart.labels', ['1st', '2nd', '3rd', '4th', '5th', '6th']); 283 //chart1.Set('chart.key', ['Aapjes', 'Hertjes']); 284 //chart1.Set('chart.key.position.y', 35); 285 //chart1.Set('chart.key.position', 'gutter'); 286 //chart1.Set('chart.key.background', 'rgb(255,255,255)'); 287 chart1.Set('chart.colors', ['#77f', '#7f7']); 288 chart1.Set('chart.shadow', true); 289 chart1.Set('chart.shadow.blur', 15); 290 chart1.Set('chart.shadow.offsetx', 0); 291 chart1.Set('chart.shadow.offsety', 0); 292 chart1.Set('chart.shadow.color', '#aaa'); 293 chart1.Set('chart.yaxispos', 'right'); 294 chart1.Set('chart.strokestyle', 'rgba(0,0,0,0)'); 295 chart1.Set('chart.gutter.left', 5); 296 chart1.Set('chart.gutter.right', 45); 297 chart1.Draw(); 298 299 } 300 301 var doorstuurData = { 302 graphs: [], 303 count: null 304 } 305 306 function addToDashboard() { 307 doorstuurData.graphs.push(["graph"+doorstuurData.count+1, 450, 200, graphSelection.graphType, graphSelection.graphData]); 308 doorstuurData.count++; 309 } -
Dev/branches/Cartis/selectSession.php
r207 r227 115 115 </fieldset> 116 116 </form> 117 <div class="LargeFrame"> 118 <div class="content"> 119 <a href="dashboardDataSelection.php"><H3>Ga naar DATA SELECTION</H3></a> 120 </div> 121 </div> 122 117 123 </div> 118 124 </div>
Note: See TracChangeset
for help on using the changeset viewer.