-
Notifications
You must be signed in to change notification settings - Fork 1
/
Colum3D.php
192 lines (172 loc) · 4.39 KB
/
Colum3D.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php require 'dados.php'; ?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Highcharts Example</title>
<style type="text/css">
/*Estilo Padrão, pode ser alterado*/
#container {
margin-top:88px;
height: 400px;
}
.highcharts-figure, .highcharts-data-table table {
min-width: 320px;
max-width: 800px;
margin: 1em auto;
}
.highcharts-data-table table {
font-family: Verdana, sans-serif;
border-collapse: collapse;
border: 1px solid #EBEBEB;
margin: 10px auto;
text-align: center;
width: 100%;
max-width: 500px;
}
.highcharts-data-table caption {
padding: 1em 0;
font-size: 1.2em;
color: #555;
}
.highcharts-data-table th {
font-weight: 600;
padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
background: #f8f8f8;
}
.highcharts-data-table tr:hover {
background: #f1f7ff;
}
button{
height: 35px;
width: 100px;
border:none;
font-size: 16px;
cursor: pointer;
}
button#plain{
background: teal;
color:#fff;
}
button#inverted{
background: tomato;
color:#fff;
}
button#polar{
background: #212121;
color:#fff;
}
</style>
</head>
<body>
<!-- ======= BIBLIOTECAS IMPORTANTES ======= -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-3d.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<!--===========TAGS PADRÃO, Possivel de Ser Alteradas ========-->
<figure class="highcharts-figure">
<div id="container"></div>
<p class="highcharts-description">
Escolha o método de visualização
</p>
<!--====Butões para alterar a previsualização do gráfico===-->
<button id="plain">Plain</button>
<button id="inverted">Inverted</button>
<button id="polar">Polar</button>
</figure>
<script type="text/javascript">
var chart = Highcharts.chart('container', {
/*Título do seu Gráfico e estilo
para maior compreensão recomendo-te ler a documentação
https://www.highcharts.com*/
title: {
text: 'ESTATÍSTICAS DOS INSCRITOS',
style:{
color:'teal',
fontSize: '30px',
},
},
subtitle: {
text: 'Plain'
},
//o Author do Gráfico
credits:{
enabled:false,
text:'Por: Afrânio Alves',
href:'http://github.com/Afranioalves',
position:{
align:'left',
x:10
},
style:{
fontSize:'15px',
color:'red',
}
},
xAxis: {
/*Dados alterados Estaticamente de acordo com as informações
da base de dados, podem ser feitas dinamicamente*/
categories: ['PHP', 'HTML5 & CSS3', 'JavaScript', 'Flutter', 'React Native']
},
series: [{
name:'Inscritos',
type: 'column',
colorByPoint: true,
data: [
/*Alterando os dados do gráfico de uma forma dinâmica
essa estrutura de condição vai apresentar no gráfico o nome do curso
e os inscritos, de acordo com os dados que estiver na
base de dados
*/
<?php while( $resultado = $busca->fetch()){?>
['<?=$resultado->Curso?>', <?=$resultado->Inscritos?> ],
<?php } ?>
],
showInLegend: false
}]
});
$('#plain').click(function () {
chart.update({
chart: {
inverted: false,
polar: false
},
subtitle: {
text: 'Plain'
}
});
});
$('#inverted').click(function () {
chart.update({
chart: {
inverted: true,
polar: false
},
subtitle: {
text: 'Inverted'
}
});
});
$('#polar').click(function () {
chart.update({
chart: {
inverted: false,
polar: true
},
subtitle: {
text: 'Polar'
}
});
});
</script>
</body>
</html>