Commit 2dd0a17fe3f36d5b6d56e54842e42cf7cc7c2bdc

Authored by Edmar Moretti
1 parent 80bee82e

inclusão de gráfico de distribuição de pontos

classesphp/funcoes_gerais.php
... ... @@ -1192,10 +1192,10 @@ function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
1192 1192 }
1193 1193 if ($tipo == "nenhum")
1194 1194 {
1195   - if (($v != "") && (is_numeric($v)))
1196   - {
  1195 + //if (($v != "") && (is_numeric($v)))
  1196 + //{
1197 1197 $valoresn[] = $v;
1198   - }
  1198 + //}
1199 1199 $valores = $valoresn;
1200 1200 }
1201 1201 }
... ...
ferramentas/graficointerativo/index.js.php
... ... @@ -137,6 +137,8 @@ i3GEOF.graficointerativo = {
137 137 ' <tr><td>&nbsp;</td></tr>' +
138 138 ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="area" name="tipoGrafico" style=cursor:pointer > </td><td>área 2d</td></tr>' +
139 139 ' <tr><td>&nbsp;</td></tr>' +
  140 + ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="scatter" name="tipoGrafico" style=cursor:pointer > </td><td>distribuição de pontos</td></tr>' +
  141 + ' <tr><td>&nbsp;</td></tr>' +
140 142  
141 143 ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="bar_filled" name="tipoGrafico" style=cursor:pointer > </td><td>barras simples</td></tr>' +
142 144 ' <tr><td>&nbsp;</td></tr>' +
... ... @@ -153,6 +155,9 @@ i3GEOF.graficointerativo = {
153 155 ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="bar_round_glass" name="tipoGrafico" style=cursor:pointer > </td><td>barras cúpula</td></tr>' +
154 156 ' <tr><td>&nbsp;</td></tr>' +
155 157 ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="bar_round" name="tipoGrafico" style=cursor:pointer > </td><td>barras pílula</td></tr>' +
  158 + ' <tr><td>&nbsp;</td></tr>' +
  159 + ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="hbar" name="tipoGrafico" style=cursor:pointer > </td><td>barras horizontais</td></tr>' +
  160 +
156 161 ' </table>' +
157 162 '</div> ' +
158 163 '<div class=guiaobj id="i3GEOgraficointerativoguia2obj" style="left:1px;display:none;top:-5px">' +
... ... @@ -177,6 +182,7 @@ i3GEOF.graficointerativo = {
177 182 '<div class=guiaobj id="i3GEOgraficointerativoguia3obj" style="left:1px;display:none;top:-5px">' +
178 183 ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoAcumula /> Utiliza valores acumulados</p>' +
179 184 ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoRelativa /> Utiliza valores relativos (%)</p>' +
  185 + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoDadosPuros /> Não processa os valores ao obter os dados (mantém os dados como estão na tabela de atributos) - essa opção é útil nos gráficos de distribuição de pontos</p>' +
180 186 '</div>'+
181 187 '<div class=guiaobj id="i3GEOgraficointerativoguia4obj" style="left:1px;display:none;top:-5px">' +
182 188 ' <div id="i3GEOgraficointerativoGrafico"></div>' +
... ... @@ -307,10 +313,14 @@ i3GEOF.graficointerativo = {
307 313 x = $i("i3GEOgraficointerativoComboXid").value,
308 314 y = $i("i3GEOgraficointerativoComboYid").value,
309 315 excluir = $i("i3GEOgraficointerativoexcluir").value,
310   - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=graficoSelecao&tema="+tema+"&itemclasses="+x+"&itemvalores="+y+"&excluir="+excluir,
  316 + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=graficoSelecao&tema="+tema+"&itemclasses="+x+"&itemvalores="+y+"&exclui="+excluir,
311 317 cp = new cpaint(),
312 318 tipo = "soma",
313 319 monta;
  320 +
  321 + if($i("i3GEOgraficointerativoDadosPuros").checked)
  322 + {tipo = "nenhum";}
  323 +
314 324 if(x === y)
315 325 {tipo = "conta";}
316 326 if(tema === "")
... ... @@ -401,6 +411,8 @@ i3GEOF.graficointerativo = {
401 411 soma = 0,
402 412 menor = inputs[1].value * 1,
403 413 maior = 0,
  414 + menorNome = inputs[0].value * 1,
  415 + maiorNome = 0,
404 416 alpha = 0.8,
405 417 stroke = 2,
406 418 gradient = true,
... ... @@ -414,7 +426,8 @@ i3GEOF.graficointerativo = {
414 426 rotacaoX = 270,
415 427 legendaX = "",
416 428 legendaY = "",
417   - fill = "#C4B86A";
  429 + fill = "#C4B86A",
  430 + pointSize = 2;
418 431 if($i("i3GEOgraficointerativoComboXid"))
419 432 {legendaX = $i("i3GEOgraficointerativoComboXid").value;}
420 433 if($i("i3GEOgraficointerativoComboYid"))
... ... @@ -431,6 +444,11 @@ i3GEOF.graficointerativo = {
431 444 {maior = temp;}
432 445 if(temp < menor)
433 446 {menor = temp;}
  447 + temp = inputs[i].value * 1;
  448 + if(temp > maiorNome)
  449 + {maiorNome = temp;}
  450 + if(temp < menorNome)
  451 + {menorNome = temp;}
434 452 par.push({"value":inputs[i+1].value * 1,"label":inputs[i].value+" "});
435 453 }
436 454 if($i("i3GEOgraficointerativoAcumula").checked){
... ... @@ -469,7 +487,7 @@ i3GEOF.graficointerativo = {
469 487 "x_axis": null
470 488 };
471 489 }
472   - if(i3GEOF.graficointerativo.tipo === "area" || i3GEOF.graficointerativo.tipo === "bar_round" || i3GEOF.graficointerativo.tipo === "bar_round_glass" || i3GEOF.graficointerativo.tipo === "bar_filled" || i3GEOF.graficointerativo.tipo === "bar_glass" || i3GEOF.graficointerativo.tipo === "bar_3d" || i3GEOF.graficointerativo.tipo === "bar_sketch" || i3GEOF.graficointerativo.tipo === "bar_cylinder" || i3GEOF.graficointerativo.tipo === "bar_cylinder_outline"){
  490 + if(i3GEOF.graficointerativo.tipo === "scatter" || i3GEOF.graficointerativo.tipo === "hbar" || i3GEOF.graficointerativo.tipo === "area" || i3GEOF.graficointerativo.tipo === "bar_round" || i3GEOF.graficointerativo.tipo === "bar_round_glass" || i3GEOF.graficointerativo.tipo === "bar_filled" || i3GEOF.graficointerativo.tipo === "bar_glass" || i3GEOF.graficointerativo.tipo === "bar_3d" || i3GEOF.graficointerativo.tipo === "bar_sketch" || i3GEOF.graficointerativo.tipo === "bar_cylinder" || i3GEOF.graficointerativo.tipo === "bar_cylinder_outline"){
473 491 parametros = {
474 492 "elements":[{
475 493 "type": i3GEOF.graficointerativo.tipo,
... ... @@ -484,7 +502,7 @@ i3GEOF.graficointerativo = {
484 502 "gradient-fill": gradient,
485 503 "fill": fill,
486 504 "fill-alpha": alpha,
487   - "dot-style": { "type": "dot", "colour": "#9C0E57", "dot-size": 7 }
  505 + "dot-style": { "type": "anchor", "colour": "#9C0E57", "dot-size": pointSize }
488 506 }],
489 507 "x_axis": {
490 508 "colour": "#A2ACBA",
... ... @@ -516,6 +534,45 @@ i3GEOF.graficointerativo = {
516 534 "style": "{font-size: "+tituloSize+"; color:"+tituloCor+"; text-align: "+tituloAlinhamento+";}"
517 535 }
518 536 };
  537 + if(i3GEOF.graficointerativo.tipo === "hbar"){
  538 + n = valores.length;
  539 + temp = [];
  540 + for(i=0;i<n;i++){
  541 + temp.push({"left":0,right:valores[i]});
  542 + }
  543 + parametros.elements[0].values = temp;
  544 +
  545 + parametros.x_axis = {
  546 + "min": 0,
  547 + "max": maior,
  548 + "steps": parseInt((maior / divisoesY),10)
  549 + }
  550 + parametros.y_axis = {
  551 + "offset": 1,
  552 + "labels": nomes
  553 + };
  554 + parametros.x_legend.text = legendaY;
  555 + parametros.y_legend.text = legendaX;
  556 + }
  557 + if(i3GEOF.graficointerativo.tipo === "scatter"){
  558 + n = valores.length;
  559 + temp = [];
  560 + for(i=0;i<n;i++){
  561 + temp.push({"x":nomes[i],"y":valores[i]});
  562 + }
  563 + parametros.elements[0].values = temp;
  564 + parametros.x_axis = {
  565 + "min": menor,
  566 + "max": maior,
  567 + "steps": parseInt(((maior - menor) / divisoesY),10)
  568 + }
  569 + parametros.x_axis = {
  570 + "min": menorNome,
  571 + "max": maiorNome,
  572 + "steps": parseInt(((maiorNome - menorNome) / divisoesY),10)
  573 + }
  574 + parametros.elements[0].tip = "#x# - #y#";
  575 + }
519 576 }
520 577 return JSON1.stringify(parametros);
521 578 }catch(erro){alert(erro);}
... ...
ms_configura.php
... ... @@ -50,7 +50,7 @@ Free Software Foundation, Inc., no endereço
50 50 Tipo:
51 51 {string}
52 52 */
53   -$mensagemInicia = 'Vers&atilde;o 4.3 - beta. Revis&atilde;o SVN 1427';
  53 +$mensagemInicia = 'Vers&atilde;o 4.3 - beta. Revis&atilde;o SVN 1446';
54 54 /*
55 55 Variable: tituloInstituicao
56 56  
... ...