source: Dev/branches/Cartis/dashboardGraphSelection.php @ 271

Last change on this file since 271 was 242, checked in by cartis, 13 years ago
File size: 5.9 KB
Line 
1<?php
2/*
3 * To change this template, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7require "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
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        <script src="RGraph/libraries/RGraph.radar.js" ></script>
29
30
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>
83       
84
85        <title>
86            Dashboard Graph Selection
87        </title>
88        <?php new Stylesheet("visualEditors"); ?>
89
90    </head>
91
92    <body>
93        <div id="header">
94
95        </div>
96
97
98        <div
99            <div id="content">
100                <div id="wrapper">
101
102                    <div id="leftColumn">
103
104                        <div class="largeFrame C" id="dbDataSelector">
105                            <div class="content">
106
107                                <div class="largeTitle">Selected data</div>                         
108                                <div class="content" style="width: 300px; height: 500px; ">               
109
110                                    <?php
111                                    print_r($data);
112                                    ?>
113
114                                </div>
115
116                            </div>
117                        </div>
118                    </div>
119
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">
129
130                                <canvas id="chart1" width="450" height="200" onclick="RGraph.showPNG(document.getElementById('radar1'));">[No canvas support] </canvas>
131                             
132                                <!-- Button to gotoDashboard?? -->                                                           
133
134                            </div>
135
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                               
140
141                            </div>
142
143                        </div>
144                    </div>
145
146
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;">
150
151                        </div>
152
153
154                    </div>
155                </div>
156
157
158
159                </body>
160                </html>
Note: See TracBrowser for help on using the repository browser.