Commit d91a0079da920078042677c4cddbd5305161003d

Authored by Edmar Moretti
1 parent 7baa5326

inclusão de gráfico do tipo linha e radar na ferramenta grafico interativo

Showing 1 changed file with 42 additions and 6 deletions   Show diff stats
ferramentas/graficointerativo/index.js.php
... ... @@ -139,6 +139,10 @@ i3GEOF.graficointerativo = {
139 139 ' <tr><td>&nbsp;</td></tr>' +
140 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 141 ' <tr><td>&nbsp;</td></tr>' +
  142 + ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="line" name="tipoGrafico" style=cursor:pointer > </td><td>linha</td></tr>' +
  143 + ' <tr><td>&nbsp;</td></tr>' +
  144 + ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="radar" name="tipoGrafico" style=cursor:pointer > </td><td>radar</td></tr>' +
  145 + ' <tr><td>&nbsp;</td></tr>' +
142 146  
143 147 ' <tr><td><input type=radio onclick="i3GEOF.graficointerativo.ativaTipo(this)" value="bar_filled" name="tipoGrafico" style=cursor:pointer > </td><td>barras simples</td></tr>' +
144 148 ' <tr><td>&nbsp;</td></tr>' +
... ... @@ -321,9 +325,10 @@ i3GEOF.graficointerativo = {
321 325  
322 326 if($i("i3GEOgraficointerativoDadosPuros").checked)
323 327 {tipo = "nenhum";}
324   -
325   - if(x === y)
326   - {tipo = "conta";}
  328 + else{
  329 + if(x === y)
  330 + {tipo = "conta";}
  331 + }
327 332 if(tema === "")
328 333 {alert("Escolha um tema");return;}
329 334 if(x === "")
... ... @@ -394,7 +399,6 @@ i3GEOF.graficointerativo = {
394 399 Obtém os dados da tabela para compor o gráfico
395 400 */
396 401 tabela2dados: function(){
397   - try{
398 402 var temp = 0,
399 403 ultimo = 0,
400 404 inputs = $i("i3GEOgraficointerativoDados").getElementsByTagName("input"),
... ... @@ -403,6 +407,7 @@ i3GEOF.graficointerativo = {
403 407 i,
404 408 parametros,
405 409 valores = [],
  410 + valoresS = [],
406 411 acumulado = [],
407 412 nomes = [],
408 413 cores = [],
... ... @@ -438,6 +443,7 @@ i3GEOF.graficointerativo = {
438 443 cores.push(inputs[i+2].value);
439 444 temp = inputs[i+1].value * 1;
440 445 valores.push(temp);
  446 + valoresS.push(temp+" ");
441 447 acumulado.push(ultimo + temp);
442 448 ultimo = ultimo + temp;
443 449 soma += temp;
... ... @@ -488,7 +494,7 @@ i3GEOF.graficointerativo = {
488 494 "x_axis": null
489 495 };
490 496 }
491   - 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"){
  497 + if(i3GEOF.graficointerativo.tipo === "line" || 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"){
492 498 parametros = {
493 499 "elements":[{
494 500 "type": i3GEOF.graficointerativo.tipo,
... ... @@ -575,8 +581,38 @@ i3GEOF.graficointerativo = {
575 581 parametros.elements[0].tip = "#x# - #y#";
576 582 }
577 583 }
  584 + if(i3GEOF.graficointerativo.tipo === "radar"){
  585 + parametros = {
  586 + "elements": [{
  587 + "type": "area",
  588 + "width": 1,
  589 + "dot-style": { "type": "anchor", "colour": "#9C0E57", "dot-size": pointSize },
  590 + "colour": "#45909F",
  591 + "fill": "#45909F",
  592 + "fill-alpha": 0.4,
  593 + "loop": true,
  594 + "values": valores
  595 + }],
  596 + "radar_axis": {
  597 + "max": maior,
  598 + "steps": parseInt(((maior - menor) / divisoesY),10),
  599 + "colour": "#EFD1EF",
  600 + "grid-colour": "#EFD1EF",
  601 + "spoke-labels": {
  602 + "labels": nomes,
  603 + "colour": "#9F819F"
  604 + }
  605 + },
  606 +
  607 + "title":{
  608 + "text": titulo,
  609 + "style": "{font-size: "+tituloSize+"; color:"+tituloCor+"; text-align: "+tituloAlinhamento+";}"
  610 + },
  611 + "bg_colour": "#DFFFEC"
  612 + };
  613 + }
  614 +
578 615 return JSON1.stringify(parametros);
579   - }catch(erro){alert(erro);}
580 616 },
581 617 /*
582 618 Function: excluilinha
... ...