[214] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * To change this template, choose Tools | Templates |
---|
| 4 | * and open the template in the editor. |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | require "classes/master.php"; |
---|
| 8 | |
---|
| 9 | $dbDataSelectionWidget = new dbDataSelectionWidget(); |
---|
| 10 | $data = JSON_decode($_POST['selectedData']); |
---|
| 11 | ?> |
---|
| 12 | |
---|
| 13 | <!DOCTYPE html> |
---|
| 14 | <html> |
---|
| 15 | <head> |
---|
| 16 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
| 17 | |
---|
[227] | 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> |
---|
[242] | 27 | <script src="RGraph/libraries/RGraph.pie.js" ></script> |
---|
| 28 | <script src="RGraph/libraries/RGraph.radar.js" ></script> |
---|
[227] | 29 | |
---|
[239] | 30 | |
---|
[227] | 31 | <script> |
---|
| 32 | myGraph.Set('chart.contextmenu', [ |
---|
| 33 | ['Get PNG', RGraph.showPNG], |
---|
| 34 | null, |
---|
| 35 | ['Cancel', function () {}] |
---|
| 36 | ]); |
---|
| 37 | </script> |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | <script> |
---|
| 41 | window.onload = function () |
---|
| 42 | { |
---|
| 43 | |
---|
| 44 | var bar1 = new RGraph.Bar('chart1', mockupData.muData3); |
---|
| 45 | //bar1.Set('chart.background.barcolor1', 'white'); |
---|
| 46 | // bar1.Set('chart.background.barcolor2', 'white'); |
---|
| 47 | bar1.Set('chart.labels', ['1st', '2nd', '3rd', '4th', '5th', '6th']); |
---|
| 48 | bar1.Set('chart.key', ['John', 'Bob']); |
---|
| 49 | bar1.Set('chart.key.position.y', 35); |
---|
| 50 | bar1.Set('chart.key.position', 'gutter'); |
---|
| 51 | bar1.Set('chart.key.background', 'rgb(255,255,255)'); |
---|
| 52 | bar1.Set('chart.colors', ['#77f', '#7f7']); |
---|
| 53 | bar1.Set('chart.shadow', true); |
---|
| 54 | bar1.Set('chart.shadow.blur', 15); |
---|
| 55 | bar1.Set('chart.shadow.offsetx', 0); |
---|
| 56 | bar1.Set('chart.shadow.offsety', 0); |
---|
| 57 | bar1.Set('chart.shadow.color', '#aaa'); |
---|
| 58 | bar1.Set('chart.yaxispos', 'right'); |
---|
| 59 | bar1.Set('chart.strokestyle', 'rgba(0,0,0,0)'); |
---|
| 60 | bar1.Set('chart.gutter.left', 5); |
---|
| 61 | bar1.Set('chart.gutter.right', 45); |
---|
| 62 | bar1.Draw(); |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | if (!RGraph.isIE8()) { |
---|
| 67 | tooltipFunc = function (i) |
---|
| 68 | { |
---|
| 69 | var r = i % 4; |
---|
| 70 | |
---|
| 71 | if (r == 3) return 'John' |
---|
| 72 | else if (r == 2) return 'Rich'; |
---|
| 73 | else if (r == 1) return 'Jane'; |
---|
| 74 | else if (r == 0) return 'Quentin'; |
---|
| 75 | } |
---|
| 76 | bar2.Set('chart.tooltips', tooltipFunc); |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | bar2.Draw(); |
---|
| 80 | |
---|
| 81 | } |
---|
| 82 | </script> |
---|
[242] | 83 | |
---|
[227] | 84 | |
---|
[214] | 85 | <title> |
---|
| 86 | Dashboard Graph Selection |
---|
| 87 | </title> |
---|
| 88 | <?php new Stylesheet("visualEditors"); ?> |
---|
| 89 | |
---|
| 90 | </head> |
---|
[227] | 91 | |
---|
[214] | 92 | <body> |
---|
| 93 | <div id="header"> |
---|
[242] | 94 | |
---|
[214] | 95 | </div> |
---|
| 96 | |
---|
[239] | 97 | |
---|
[242] | 98 | <div |
---|
| 99 | <div id="content"> |
---|
| 100 | <div id="wrapper"> |
---|
[214] | 101 | |
---|
[242] | 102 | <div id="leftColumn"> |
---|
[214] | 103 | |
---|
[242] | 104 | <div class="largeFrame C" id="dbDataSelector"> |
---|
| 105 | <div class="content"> |
---|
[214] | 106 | |
---|
[242] | 107 | <div class="largeTitle">Selected data</div> |
---|
| 108 | <div class="content" style="width: 300px; height: 500px; "> |
---|
[227] | 109 | |
---|
[242] | 110 | <?php |
---|
| 111 | print_r($data); |
---|
| 112 | ?> |
---|
[227] | 113 | |
---|
[242] | 114 | </div> |
---|
[214] | 115 | |
---|
[242] | 116 | </div> |
---|
[214] | 117 | </div> |
---|
| 118 | </div> |
---|
| 119 | |
---|
[242] | 120 | <div id="rightColumn"> |
---|
| 121 | <div class="largeFrame Cv" style="width: 600px; height: 400px;"> |
---|
| 122 | <div class="largeTitle">Graph selection</div> |
---|
| 123 | <div class="topControls" id="graphTypeSelector" style="float: left; clear: left; width: 100%; margin: 0; border: 1px solid #000;"> |
---|
| 124 | <div id="btnSelectPieType" class="graphSelectionButton" onclick="changeGraphType('pie')">PIE CHART</div> |
---|
| 125 | <div id="btnSelectBarType" class="graphSelectionButton" onclick="changeGraphType('bar')">BAR CHART</div> |
---|
| 126 | <div id="btnSelectRadarType" class="graphSelectionButton" onclick="changeGraphType('radar')">RADAR CHART</div> |
---|
| 127 | </div> |
---|
| 128 | <div class="content" id="graphDisplay"> |
---|
[214] | 129 | |
---|
[242] | 130 | <canvas id="chart1" width="450" height="200" onclick="RGraph.showPNG(document.getElementById('radar1'));">[No canvas support] </canvas> |
---|
| 131 | |
---|
| 132 | <!-- Button to gotoDashboard?? --> |
---|
[227] | 133 | |
---|
[242] | 134 | </div> |
---|
[227] | 135 | |
---|
[242] | 136 | <div class="controls"> |
---|
| 137 | <input type="button" class="smallButton" value="Save to dashboard" onClick="addToDashboard()"></input> |
---|
| 138 | <input type="button" class="smallButton" value="Go to Dashboard" onClick="gotoDashboard()"></input> |
---|
| 139 | |
---|
[227] | 140 | |
---|
[242] | 141 | </div> |
---|
[227] | 142 | |
---|
| 143 | </div> |
---|
[214] | 144 | </div> |
---|
| 145 | |
---|
| 146 | |
---|
[242] | 147 | <div class="largeFrame Cu" id="dbInfoPanel" style="width: 930px;"> |
---|
| 148 | <div class='largeTitle'>Info panel</div> |
---|
| 149 | <div class="content" id="dbInfoPanelContent" style="height: 100px;"> |
---|
[214] | 150 | |
---|
[242] | 151 | </div> |
---|
[227] | 152 | |
---|
| 153 | |
---|
[242] | 154 | </div> |
---|
[214] | 155 | </div> |
---|
| 156 | |
---|
| 157 | |
---|
[227] | 158 | |
---|
[242] | 159 | </body> |
---|
| 160 | </html> |
---|