Commit 6b7c17511133327a2e58742e7683bcb2b708b7ba

Authored by Edmar Moretti
1 parent 619f4c97

$1

admin/admin.db
No preview for this file type
admin/php/classe_metaestat.php
... ... @@ -372,6 +372,7 @@ class Metaestat{
372 372 //
373 373 //prepara os alias das colunas
374 374 //
  375 + $colunas = array_unique($colunas);
375 376 $alias = $colunas;
376 377 $n = count($colunas);
377 378 for($i=0;$i<$n;$i++){
... ... @@ -541,7 +542,7 @@ class Metaestat{
541 542 //echo $sqlf;exit;
542 543 if(!empty($filtro)){
543 544 $sqlf = str_replace("__filtro__"," AND ".$filtro." /*FA*//*FA*/ /*FAT*//*FAT*/",$sqlf);
544   - $sql["titulo"] .= ", ".$filtro;
  545 + $sql["titulo"] .= " - ".$filtro;
545 546 }
546 547 else{
547 548 $sqlf = str_replace("__filtro__"," /*FA*//*FA*/ /*FAT*//*FAT*/",$sqlf);
... ... @@ -560,6 +561,9 @@ class Metaestat{
560 561 else{
561 562 $titulolayer = mb_convert_encoding($sql["titulo"],"ISO-8859-1",mb_detect_encoding($sql["titulo"]));
562 563 }
  564 + //necessario para evitar problemas com ITENSDESC
  565 + $titulolayer = str_replace(","," ",$titulolayer);
  566 + $titulolayer = str_replace("=",": ",$titulolayer);
563 567 //pega os parametros caso seja um mapfile para WMS-time
564 568 if($suportaWMST == true){
565 569 $sqlMinMax = "select min(dimtempo) as min,max(dimtempo) as max from(".$sql["sql"].") as x";
... ... @@ -920,7 +924,7 @@ class Metaestat{
920 924 $sqlf .= " limit ".$limite;
921 925 }
922 926 $metaVariavel = $this->listaMedidaVariavel("",$id_medida_variavel);
923   -
  927 +
924 928 if(!empty($metaVariavel["codigo_estat_conexao"])){
925 929 $c = $this->listaConexao($metaVariavel["codigo_estat_conexao"],true);
926 930 $dbhold = $this->dbh;
... ...
classesphp/classe_atributos.php
... ... @@ -2290,6 +2290,7 @@ class Atributos
2290 2290 $resultado[] = $shape->values[$item];
2291 2291 }
2292 2292 else{
  2293 + //var_dump($itens);exit;
2293 2294 foreach ($itens as $it){
2294 2295 $val = $shape->values[$it];
2295 2296 if($convC == true){
... ...
classesphp/graficos.php
... ... @@ -377,11 +377,10 @@ function iniciaParGrafico($gw,$gh,$res,$dir_tmp,$gfile_name,$margem,$margemexter
377 377 function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,$percentual,$ext="",$incluicores=true,$ordenax="nao")
378 378 {
379 379 global $interface;
380   - //pega os valores
381   - //error_reporting(0);
  380 + //prepara o mapfile
  381 + //
382 382 $map = ms_newMapObj($map_file);
383   - if($interface == "googlemaps")
384   - {
  383 + if($interface == "googlemaps"){
385 384 $projMapa = $map->getProjection();
386 385 $map->setProjection("init=epsg:4618,a=6378137,b=6378137");
387 386 }
... ... @@ -391,57 +390,70 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t
391 390 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3])));
392 391 }
393 392 $layer = $map->getLayerByName($tema);
  393 + //verifica se tem selecao
394 394 $selecionados = carregaquery2($map_file,$layer,$map);
395 395 if ($exclui == ""){$exclui = "nulo";}
396   - $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados);
397   - $dados = agrupaValores($valores,0,1,$tipo);
398   - foreach($valores as $valor){
399   - $cores[$valor[0]] = $valor["cores"];
400   - }
401   - //calcula os parametros para o grafico
402   - $nval = count($dados);
403   - $max = max($dados);
404   - $soma = array_sum($dados);
405   - $tempm = array_keys($dados);
406   - $tempval = array();
407   - $nnval[] = "n;x";
408   - if ($tipo != "xy")
409   - {
410   - for ($i=0;$i < $nval; ++$i)
411   - {
412   - if ($dados[$tempm[$i]] > 0)
413   - {
414   - $pp = ($dados[$tempm[$i]] * 100) / $soma;
415   - if ($percentual == "TRUE")
416   - {
417   -
418   - $temp = "'".$tempm[$i]." (".round($pp,0)."%)';".$dados[$tempm[$i]];
419   - if($incluicores == true)
420   - {$temp = $temp.";".$cores[$tempm[$i]];}
  396 + //pega os valores
  397 + //$itemvalores pode ser um array de intens
  398 + $nnval = array();
  399 + if(!is_array($itemvalores)){
  400 + $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados);
  401 + //agrupa se for o caso
  402 + $dados = agrupaValores($valores,0,1,$tipo);
  403 + foreach($valores as $valor){
  404 + $cores[$valor[0]] = $valor["cores"];
  405 + }
  406 + //calcula os parametros para o grafico
  407 + $nval = count($dados);
  408 + $max = max($dados);
  409 + $soma = array_sum($dados);
  410 + $tempm = array_keys($dados);
  411 + $tempval = array();
  412 + $nnval[] = "n;x";
  413 + if ($tipo != "xy"){
  414 + for ($i=0;$i < $nval; ++$i){
  415 + if ($dados[$tempm[$i]] > 0){
  416 + $pp = ($dados[$tempm[$i]] * 100) / $soma;
  417 + if ($percentual == "TRUE"){
  418 + $temp = "'".$tempm[$i]." (".round($pp,0)."%)';".$dados[$tempm[$i]];
  419 + if($incluicores == true){
  420 + $temp = $temp.";".$cores[$tempm[$i]];
  421 + }
  422 + }
  423 + else{
  424 + $temp = "'".$tempm[$i]."';".$dados[$tempm[$i]];
  425 + if($incluicores == true){
  426 + $temp = $temp.";".$cores[$tempm[$i]];
  427 + }
  428 + }
  429 + $tempval[] = $temp;
421 430 }
422   - else
423   - {
424   - $temp = "'".$tempm[$i]."';".$dados[$tempm[$i]];
425   - if($incluicores == true)
426   - {$temp = $temp.";".$cores[$tempm[$i]];}
  431 + }
  432 + }
  433 + else{
  434 + foreach ($valores as $v){
  435 + $temp = $v[0].";".$v[1];
  436 + if($incluicores == true){
  437 + $temp = $temp.";".$cores[$v[0]];
427 438 }
428 439 $tempval[] = $temp;
429 440 }
430 441 }
431   - }
432   - else
433   - {
434   - foreach ($valores as $v)
435   - {
436   - $temp = $v[0].";".$v[1];
437   - if($incluicores == true)
438   - {$temp = $temp.";".$cores[$v[0]];}
439   - $tempval[] = $temp;
  442 + if($ordenax == "sim"){
  443 + sort($tempval);
440 444 }
  445 + $nnval = array_merge($nnval,$tempval);
  446 + }
  447 + else{
  448 + $colunas = array_merge(array($itemclasses),$itemvalores);
  449 + $valores = pegaValoresM($map,$layer,$colunas,$exclui,$selecionados);
  450 + $nval = count($dados);
  451 + $nnval[] = implode(";",$colunas);
  452 + foreach($valores as $valor){
  453 + $nnval[] = implode(";",$valor);
  454 + }
  455 + $max = "";
441 456 }
442   - if($ordenax == "sim")
443   - {sort($tempval);}
444   - $nnval = array_merge($nnval,$tempval);
445 457 return array("dados"=>$nnval,"ndados"=>$nval,"max"=>$max);
446 458 }
447 459 function dadosLinhaDoTempo($map_file,$tema,$ext="")
... ... @@ -654,8 +666,7 @@ function pegaValoresM($mapa,$layer,$itens,$exclui=&quot;nulo&quot;,$selecionados=&quot;nao&quot;,$ch
654 666  
655 667 $indicesel = array();
656 668 //pega os valores dos indices dos elementos selecionados para comparacao posterior
657   - if ($selecionados == "sim")
658   - {
  669 + if ($selecionados == "sim"){
659 670 $sopen = $layer->open();
660 671 if($sopen == MS_FAILURE){return "erro";}
661 672 $res_count = $layer->getNumresults();
... ... @@ -668,15 +679,12 @@ function pegaValoresM($mapa,$layer,$itens,$exclui=&quot;nulo&quot;,$selecionados=&quot;nao&quot;,$ch
668 679 }
669 680 $valores = array();
670 681 $nclasses = $layer->numclasses;
671   - if (@$layer->queryByrect($mapa->extent) == MS_SUCCESS)
672   - {
  682 + if (@$layer->queryByrect($mapa->extent) == MS_SUCCESS){
673 683 //$layer->draw();
674 684 $sopen = $layer->open();
675 685 if($sopen == MS_FAILURE){return "erro";}
676 686 $res_count = $layer->getNumresults();
677   -
678   - for ($i=0;$i<$res_count;++$i)
679   - {
  687 + for ($i=0;$i<$res_count;++$i){
680 688 if($versao == 6){
681 689 $shape = $layer->getShape($layer->getResult($i));
682 690 $shp_index = $shape->index;
... ... @@ -690,40 +698,42 @@ function pegaValoresM($mapa,$layer,$itens,$exclui=&quot;nulo&quot;,$selecionados=&quot;nao&quot;,$ch
690 698 {continue;}
691 699 $considera = "sim";
692 700 //verifica se no registro deve ser considerado
693   - if ($exclui != "nulo")
694   - {
  701 + if ($exclui != "nulo"){
695 702 foreach ($itens as $item)
696 703 {if($shape->values[$item] == $exclui){$considera = "nao";}}
697 704 }
698 705 //pega os valores
699 706 $v = array();
700   - if ($considera == "sim")
701   - {
  707 + if ($considera == "sim"){
  708 + //pega os valores dos itens do registro
702 709 foreach ($itens as $item){
703 710 if($chaves == false)
704 711 {$v[] = $shape->values[$item];}
705 712 else
706 713 {$v[$item] = $shape->values[$item];}
707 714 }
  715 + //pega o centroide
708 716 if($centroide == true){
709 717 $c = $shape->getCentroid();
710   - if (($prjTema != "") && ($prjMapa != $prjTema))
711   - {
  718 + if (($prjTema != "") && ($prjMapa != $prjTema)){
712 719 $projOutObj = ms_newprojectionobj($prjTema);
713 720 $projInObj = ms_newprojectionobj($prjMapa);
714 721 $c->project($projInObj, $projOutObj);
715 722 }
716 723 $v["centroide"] = "POINT(".$c->x." ".$c->y.")";
717 724 }
  725 + //pega a cor da classe onde cai o registro
718 726 if($nclasses > 0){
719 727 $classe = $layer->getclass($layer->getClassIndex($shape));
720 728 $cor = $classe->getstyle(0)->color;
721 729 $v["cores"] = $cor->red." ".$cor->green." ".$cor->blue;
722 730 }
723   - if (count($v) == 1)
724   - {$valores[] = $v[0];}
725   - else
726   - {$valores[] = $v;}
  731 + if (count($v) == 1){
  732 + $valores[] = $v[0];
  733 + }
  734 + else{
  735 + $valores[] = $v;
  736 + }
727 737 }
728 738 }
729 739 $layer->close();
... ... @@ -754,12 +764,10 @@ Retorno:
754 764 function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
755 765 {
756 766 $valores = null;
757   - foreach ($lista as $linha)
758   - {
  767 + foreach ($lista as $linha){
759 768 $c = $linha[$indiceChave];
760 769 $v = $linha[$indiceValor];
761   - if ($tipo == "conta")
762   - {
  770 + if ($tipo == "conta"){
763 771 if(@$valores[$c])
764 772 $valores[$c] = $valores[$c] + 1;
765 773 else
... ... @@ -767,18 +775,15 @@ function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
767 775 }
768 776 if (($tipo == "soma"))
769 777 {
770   - if (($v != "") && (is_numeric($v)))
771   - {
  778 + if (($v != "") && (is_numeric($v))){
772 779 if(@$valores[$c])
773 780 $valores[$c] = $valores[$c] + $v;
774 781 else
775 782 $valores[$c] = $v;
776 783 }
777 784 }
778   - if ($tipo == "media")
779   - {
780   - if (($v != "") && (is_numeric($v)))
781   - {
  785 + if ($tipo == "media"){
  786 + if (($v != "") && (is_numeric($v))){
782 787 if(@$soma[$c])
783 788 $soma[$c] = $soma[$c] + $v;
784 789 else
... ... @@ -790,8 +795,7 @@ function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
790 795 $conta[$c] = 1;
791 796 }
792 797 }
793   - if ($tipo == "nenhum")
794   - {
  798 + if ($tipo == "nenhum"){
795 799 //if (($v != "") && (is_numeric($v)))
796 800 //{
797 801 $valoresn[] = $v;
... ... @@ -799,11 +803,9 @@ function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
799 803 $valores = $valoresn;
800 804 }
801 805 }
802   - if ($tipo == "media")
803   - {
  806 + if ($tipo == "media"){
804 807 $chaves = array_keys($conta);
805   - foreach ($chaves as $c)
806   - {
  808 + foreach ($chaves as $c){
807 809 $valores[$c] = $soma[$c] / $conta[$c];
808 810 }
809 811 }
... ...
css/geral.css
... ... @@ -25,6 +25,11 @@ legend
25 25 {font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;}
26 26 .paragrafo
27 27 {font-size:12px;line-height:15px;margin-bottom:9px;text-align:left;}
  28 +.paragrafo input[type=checkbox]{
  29 + position:relative;
  30 + top: 2px;
  31 + border: 0px solid white;
  32 +}
28 33 .lista td
29 34 {border: 0px solid rgb(240,240,240);border-left: 0px;border-right:0px;border-top:0px;padding: 0px;color:#2F4632;margin:0px;text-align:left;font-size: 11px;font-family: Verdana, Arial, Helvetica, sans-serif;}
30 35 .lista2 td
... ...
css/i3geo5.css
... ... @@ -25,6 +25,11 @@ legend
25 25 {font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;}
26 26 .paragrafo
27 27 {font-size:12px;line-height:15px;margin-bottom:9px;text-align:left;}
  28 +.paragrafo input[type=checkbox]{
  29 +position:relative;
  30 +top: 2px;
  31 +border: 0px solid white;
  32 +}
28 33 .lista td
29 34 {border: 0px solid rgb(240,240,240);border-left: 0px;border-right:0px;border-top:0px;padding: 0px;color:#2F4632;margin:0px;text-align:left;font-size: 11px;font-family: Verdana, Arial, Helvetica, sans-serif;}
30 35 .lista2 td
... ...
css/i3geo5.css.php
... ... @@ -25,6 +25,11 @@ legend
25 25 {font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;}
26 26 .paragrafo
27 27 {font-size:12px;line-height:15px;margin-bottom:9px;text-align:left;}
  28 +.paragrafo input[type=checkbox]{
  29 +position:relative;
  30 +top: 2px;
  31 +border: 0px solid white;
  32 +}
28 33 .lista td
29 34 {border: 0px solid rgb(240,240,240);border-left: 0px;border-right:0px;border-top:0px;padding: 0px;color:#2F4632;margin:0px;text-align:left;font-size: 11px;font-family: Verdana, Arial, Helvetica, sans-serif;}
30 35 .lista2 td
... ...
ferramentas/graficointerativo1/dicionario.js
... ... @@ -85,7 +85,7 @@ i3GEOF.graficointerativo1.dicionario = {
85 85 it:""
86 86 }],
87 87 15: [{
88   - pt:"Item com os valores ou eixo Y",
  88 + pt:"Item(ns) com os valores ou eixo Y",
89 89 en:"",
90 90 es:"",
91 91 it:""
... ... @@ -277,19 +277,19 @@ i3GEOF.graficointerativo1.dicionario = {
277 277 it:""
278 278 }],
279 279 47: [{
280   - pt:"",
  280 + pt:"Atualiza o gr&aacute;fico ao navegar pelo mapa",
281 281 en:"",
282 282 es:"",
283 283 it:""
284 284 }],
285 285 48: [{
286   - pt:"",
  286 + pt:"Utiliza barras divididas entre os valores (stacked)",
287 287 en:"",
288 288 es:"",
289 289 it:""
290 290 }],
291 291 49: [{
292   - pt:"",
  292 + pt:"As linhas de dados ficam nas colunas",
293 293 en:"",
294 294 es:"",
295 295 it:""
... ...
ferramentas/graficointerativo1/exec.php
... ... @@ -21,6 +21,10 @@ Pega os dados necessários para a geração dos gráficos da ferramenta seleção
21 21 {$tipo = "nenhum";}
22 22 if(!isset($ordenax))
23 23 {$ordenax = "nao";}
  24 + $itemvalores = explode(",",$itemvalores);
  25 + if(count($itemvalores) == 1){
  26 + $itemvalores = $itemvalores[0];
  27 + }
24 28 $retorno = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,false,$ext,true,$ordenax);
25 29 break;
26 30 }
... ...
ferramentas/graficointerativo1/index.js
1   -
2   -/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */
3 1 /*
4 2 Title: Gr&aacute;fico interativo 1
5 3  
... ... @@ -39,1045 +37,1277 @@ GNU junto com este programa; se n&amp;atilde;o, escreva para a
39 37 Free Software Foundation, Inc., no endere&ccedil;o
40 38 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
41 39 */
42   -if(typeof(i3GEOF) === 'undefined'){
  40 +if (typeof (i3GEOF) === 'undefined') {
43 41 var i3GEOF = {};
44 42 }
45 43 /*
46   -Classe: i3GEOF.graficointerativo1
47   -
  44 + * Classe: i3GEOF.graficointerativo1
  45 + *
48 46 */
49 47 i3GEOF.graficointerativo1 = {
50   - /*
51   - Variavel: aguarde
52   -
53   - Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.
54   - */
55   - aguarde: "",
56   - /*
57   - Propriedade: dados
58   -
59   - Dados que serao utilizados. Pode ser passado como parametro.
60   -
61   - Default:
62   - {false}
63   - */
64   - dados:false,
65   - /*
66   - Propriedade: titulo
67   -
68   - T&iacute;tulo do gr&aacute;fico. Se for vazio, ser&aacute; obtido do nome do tema selecionado
69   - */
70   - titulo: "",
71   - /*
72   - Propriedade: tipo
73   -
74   - Tipo de gr&aacute;fico escolhido pelo usu&aacute;rio.
75   - */
76   - tipo: "",
77   - /*
78   - Propriedade: acumula
79   -
80   - Acumula os valores ao gerar o gr&aacute;fico
81   -
82   - Type:
83   - {boolean}
84   -
85   - Default:
86   - {false}
87   - */
88   - acumula: false,
89   - /*
90   - Propriedade: relativa
91   -
92   - Utiliza valores relativos ao criar o gr&aacute;fico
93   -
94   - Type:
95   - {boolean}
96   -
97   - Default:
98   - {false}
99   - */
100   - relativa: false,
101   - /*
102   - Propriedade: dadospuros
103   -
104   - N&atilde;o faz nenhum tipo de processamento nos dados antes de gerar o gr&aacute;fico
105   -
106   - Type:
107   - {boolean}
108   -
109   - Default:
110   - {false}
111   - */
112   - dadospuros: false,
113   - /*
114   - Propriedade: navegacao
115   -
116   - Ativa ou n&atilde;o a navega&ccedil;&atilde;o dinâmica do mapa
117   -
118   - Type:
119   - {boolean}
120   -
121   - Default:
122   - {false}
123   - */
124   - navegacao:false,
125   -
126   - /*
127   - Para efeitos de compatibilidade antes da vers&atilde;o 4.7 que n&atilde;o tinha dicion&aacute;rio
128   - */
129   - criaJanelaFlutuante: function(dados){
130   - if(dados){
131   - i3GEOF.graficointerativo1.dados = dados;
132   - }
133   - i3GEOF.graficointerativo1.iniciaDicionario();
134   - },
135   - /*
136   - Function: iniciaDicionario
137   -
138   - Carrega o dicion&aacute;rio e chama a fun&ccedil;&atilde;o que inicia a ferramenta
139   -
140   - O Javascript &eacute; carregado com o id i3GEOF.nomedaferramenta.dicionario_script
141   - */
142   - iniciaDicionario: function(dados){
143   - if(dados){
144   - i3GEOF.graficointerativo1.dados = dados;
145   - }
146   - if(typeof(i3GEOF.graficointerativo1.dicionario) === 'undefined'){
147   - i3GEO.util.scriptTag(
148   - i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",
149   - "i3GEOF.graficointerativo1.iniciaJanelaFlutuante()",
150   - "i3GEOF.graficointerativo1.dicionario_script"
151   - );
152   - }
153   - else{
154   - i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);
  48 + /*
  49 + * Variavel: aguarde
  50 + *
  51 + * Estilo do objeto DOM com a imagem de aguarde existente no
  52 + * cabe&ccedil;alho da janela.
  53 + */
  54 + aguarde : "",
  55 + /*
  56 + * Propriedade: dados
  57 + *
  58 + * Dados que serao utilizados. Pode ser passado como parametro.
  59 + *
  60 + * Default: {false}
  61 + */
  62 + dados : false,
  63 + /*
  64 + * Propriedade: titulo
  65 + *
  66 + * T&iacute;tulo do gr&aacute;fico. Se for vazio, ser&aacute; obtido do nome
  67 + * do tema selecionado
  68 + */
  69 + titulo : "",
  70 + /*
  71 + * Propriedade: tipo
  72 + *
  73 + * Tipo de gr&aacute;fico escolhido pelo usu&aacute;rio.
  74 + */
  75 + tipo : "",
  76 + /*
  77 + * Propriedade: acumula
  78 + *
  79 + * Acumula os valores ao gerar o gr&aacute;fico
  80 + *
  81 + * Type: {boolean}
  82 + *
  83 + * Default: {false}
  84 + */
  85 + acumula : false,
  86 + /*
  87 + * Propriedade: relativa
  88 + *
  89 + * Utiliza valores relativos ao criar o gr&aacute;fico
  90 + *
  91 + * Type: {boolean}
  92 + *
  93 + * Default: {false}
  94 + */
  95 + relativa : false,
  96 + /*
  97 + * Propriedade: dadospuros
  98 + *
  99 + * N&atilde;o faz nenhum tipo de processamento nos dados antes de gerar o
  100 + * gr&aacute;fico
  101 + *
  102 + * Type: {boolean}
  103 + *
  104 + * Default: {false}
  105 + */
  106 + dadospuros : false,
  107 + /*
  108 + * Propriedade: navegacao
  109 + *
  110 + * Ativa ou n&atilde;o a navega&ccedil;&atilde;o dinâmica do mapa
  111 + *
  112 + * Type: {boolean}
  113 + *
  114 + * Default: {false}
  115 + */
  116 + navegacao : false,
  117 +
  118 + /*
  119 + * Para efeitos de compatibilidade antes da vers&atilde;o 4.7 que n&atilde;o
  120 + * tinha dicion&aacute;rio
  121 + */
  122 + criaJanelaFlutuante : function(dados) {
  123 + if (dados) {
  124 + i3GEOF.graficointerativo1.dados = dados;
  125 + }
  126 + i3GEOF.graficointerativo1.iniciaDicionario();
  127 + },
  128 + /*
  129 + * Function: iniciaDicionario
  130 + *
  131 + * Carrega o dicion&aacute;rio e chama a fun&ccedil;&atilde;o que inicia a
  132 + * ferramenta
  133 + *
  134 + * O Javascript &eacute; carregado com o id
  135 + * i3GEOF.nomedaferramenta.dicionario_script
  136 + */
  137 + iniciaDicionario : function(dados) {
  138 + if (dados) {
  139 + i3GEOF.graficointerativo1.dados = dados;
  140 + }
  141 + if (typeof (i3GEOF.graficointerativo1.dicionario) === 'undefined') {
  142 + i3GEO.util.scriptTag(i3GEO.configura.locaplic
  143 + + "/ferramentas/graficointerativo1/dependencias.php",
  144 + "i3GEOF.graficointerativo1.iniciaJanelaFlutuante()",
  145 + "i3GEOF.graficointerativo1.dicionario_script");
  146 + } else {
  147 + i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);
  148 + }
  149 + },
  150 + /*
  151 + * Function: inicia
  152 + *
  153 + * Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante
  154 + *
  155 + * Parametros:
  156 + *
  157 + * iddiv {String} - id do div que receber&aacute; o conteudo HTML da
  158 + * ferramenta
  159 + *
  160 + * dados {JSON} - dados para o gr&aacute;fico (opcional) exemplo
  161 + * ["n;x","'Argentina';33796870","'Paraguay';4773464","'Brazil';151525400","'Chile';13772710"]
  162 + */
  163 + inicia : function(iddiv) {
  164 + // try{
  165 + $i(iddiv).innerHTML += i3GEOF.graficointerativo1.html();
  166 + $i("i3GEOgraficointerativo1Acumula").checked = i3GEOF.graficointerativo1.acumula;
  167 + $i("i3GEOgraficointerativo1Relativa").checked = i3GEOF.graficointerativo1.relativa;
  168 + $i("i3GEOgraficointerativo1DadosPuros").checked = i3GEOF.graficointerativo1.dadospuros;
  169 + if (i3GEOF.graficointerativo1.navegacao === true) {
  170 + i3GEOF.graficointerativo1.ativaNavegacao(true);
  171 + }
  172 + // eventos das guias
  173 + $i("i3GEOgraficointerativo1guia1").onclick = function() {
  174 + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
  175 + "i3GEOgraficointerativo1guia");
  176 + $i("i3GEOgraficointerativo1Grafico").style.display = "none";
  177 + };
  178 + $i("i3GEOgraficointerativo1guia2").onclick = function() {
  179 + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia2",
  180 + "i3GEOgraficointerativo1guia");
  181 + i3GEOF.graficointerativo1.configuraDados();
  182 + $i("i3GEOgraficointerativo1Grafico").style.display = "none";
  183 + };
  184 + $i("i3GEOgraficointerativo1guia3").onclick = function() {
  185 + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3",
  186 + "i3GEOgraficointerativo1guia");
  187 + $i("i3GEOgraficointerativo1Grafico").style.display = "none";
  188 + };
  189 + $i("i3GEOgraficointerativo1guia4").onclick = function() {
  190 + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia4",
  191 + "i3GEOgraficointerativo1guia");
  192 + var t = $i("i3GEOgraficointerativo1Grafico");
  193 + t.style.display = "block";
  194 + t.style.position = "relative";
  195 + t.style.top = "-5px";
  196 + t.visibility = "visible";
  197 + i3GEOF.graficointerativo1.tabela2dados();
  198 + };
  199 + $i("i3GEOgraficointerativo1guia5").onclick = function() {
  200 + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia5",
  201 + "i3GEOgraficointerativo1guia");
  202 + $i("i3GEOgraficointerativo1Grafico").style.display = "none";
  203 + $i("i3GEOgraficointerativo1guia5obj").innerHTML = "<textarea rows='20' cols='52' >"
  204 + + (i3GEOF.graficointerativo1.tabela2csv()).join("\n")
  205 + + "</textarea>";
  206 + };
  207 +
  208 + i3GEOF.graficointerativo1.ativaFoco();
  209 + i3GEOF.graficointerativo1.comboTemas();
  210 + new YAHOO.widget.Button("i3GEOgraficointerativo1botao1", {
  211 + onclick : {
  212 + fn : i3GEOF.graficointerativo1.obterDados
155 213 }
156   - },
157   - /*
158   - Function: inicia
159   -
160   - Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante
161   -
162   - Parametros:
163   -
164   - iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta
165   -
166   - dados {JSON} - dados para o gr&aacute;fico (opcional) exemplo ["n;x","'Argentina';33796870","'Paraguay';4773464","'Brazil';151525400","'Chile';13772710"]
167   - */
168   - inicia: function(iddiv){
169   - //try{
170   - $i(iddiv).innerHTML += i3GEOF.graficointerativo1.html();
171   - $i("i3GEOgraficointerativo1Acumula").checked = i3GEOF.graficointerativo1.acumula;
172   - $i("i3GEOgraficointerativo1Relativa").checked = i3GEOF.graficointerativo1.relativa;
173   - $i("i3GEOgraficointerativo1DadosPuros").checked = i3GEOF.graficointerativo1.dadospuros;
174   - if(i3GEOF.graficointerativo1.navegacao === true)
175   - {i3GEOF.graficointerativo1.ativaNavegacao(true);}
176   - //eventos das guias
177   - $i("i3GEOgraficointerativo1guia1").onclick = function(){
178   - i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia");
179   - $i("i3GEOgraficointerativo1Grafico").style.display = "none";
180   - };
181   - $i("i3GEOgraficointerativo1guia2").onclick = function(){
182   - i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia2","i3GEOgraficointerativo1guia");
183   - i3GEOF.graficointerativo1.configuraDados();
184   - $i("i3GEOgraficointerativo1Grafico").style.display = "none";
185   - };
186   - $i("i3GEOgraficointerativo1guia3").onclick = function(){
187   - i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3","i3GEOgraficointerativo1guia");
188   - $i("i3GEOgraficointerativo1Grafico").style.display = "none";
189   - };
190   - $i("i3GEOgraficointerativo1guia4").onclick = function(){
191   - i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia4","i3GEOgraficointerativo1guia");
192   - var t = $i("i3GEOgraficointerativo1Grafico"),
193   - dados = i3GEOF.graficointerativo1.tabela2dados();
194   - t.style.display = "block";
195   - t.style.position = "relative";
196   - t.style.top = "-5px";
197   - t.visibility = "visible";
198   - };
199   - $i("i3GEOgraficointerativo1guia5").onclick = function(){
200   - i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia5","i3GEOgraficointerativo1guia");
201   - $i("i3GEOgraficointerativo1Grafico").style.display = "none";
202   - $i("i3GEOgraficointerativo1guia5obj").innerHTML = "<textarea rows='20' cols='52' >"+(i3GEOF.graficointerativo1.tabela2csv()).join("\n")+"</textarea>";
203   - };
204   -
  214 + });
  215 + if (i3GEOF.graficointerativo1.dados
  216 + && i3GEOF.graficointerativo1.dados != "undefined") {
  217 + // i3GEOF.graficointerativo1.tipo = "pizza2d";
  218 + // var retorno =
  219 + // {"attributes":{"id":""},"data":{"dados":["n;x","'4';3839572","'8';81710320","'7';24631314","'2';10967753","'1';24496400","'3';18752482","'5';13574480","'6';216507515"]}};
  220 + i3GEOF.graficointerativo1
  221 + .montaTabelaDados(i3GEOF.graficointerativo1.dados);
  222 + $i("i3GEOgraficointerativo1guia4").onclick.call();
  223 + }
  224 + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
  225 + "i3GEOgraficointerativo1guia");
  226 + // }
  227 + // catch(erro){i3GEO.janela.tempoMsg(erro);}
  228 + },
  229 + /*
  230 + * Function: html
  231 + *
  232 + * Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das
  233 + * op&ccedil;&otilde;es da ferramenta
  234 + *
  235 + * Retorno:
  236 + *
  237 + * String com o c&oacute;digo html
  238 + */
  239 + html : function() {
  240 + var locaplic = i3GEO.configura.locaplic, ins = ''
  241 + + '<div id=i3GEOgraficointerativo1guiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">'
  242 + + ' <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">'
  243 + + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia3" style="text-align:center;left:0px;" ><img class="ticPropriedades2" style="height:14px" title="'
  244 + + $trad("p13")
  245 + + '" src="'
  246 + + i3GEO.configura.locaplic
  247 + + '/imagens/visual/default/branco.gif"></div></em></a></li>'
  248 + + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia1" style="text-align:center;left:0px;" >'
  249 + + $trad(1, i3GEOF.graficointerativo1.dicionario)
  250 + + '</div></em></a></li>'
  251 + + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia2" style="text-align:center;left:0px;" >'
  252 + + $trad(2, i3GEOF.graficointerativo1.dicionario)
  253 + + '</div></em></a></li>'
  254 + + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia4" style="text-align:center;left:0px;" >'
  255 + + $trad(3, i3GEOF.graficointerativo1.dicionario)
  256 + + '</div></em></a></li>'
  257 + + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia5" style="text-align:center;left:0px;" >CSV</div></em></a></li>'
  258 + + ' </ul>'
  259 + + '</div><br>'
  260 + + '<div class=guiaobj id="i3GEOgraficointerativo1guia1obj" style="left:1px;display:none;">'
  261 + + ' <p class=paragrafo >'
  262 + + $trad(4, i3GEOF.graficointerativo1.dicionario)
  263 + + ': </p>'
  264 + + ' <table class=lista6 >'
  265 + + ' <tr><td><img style=cursor:text; src="'
  266 + + locaplic
  267 + + '/imagens/oxygen/22x22/Actions-office-chart-pie-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="pizza_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'
  268 + + $trad(5, i3GEOF.graficointerativo1.dicionario)
  269 + + '</td></tr>'
  270 + + ' <tr><td>&nbsp;</td></tr>'
  271 + + ' <tr><td><img style=cursor:text; src="'
  272 + + locaplic
  273 + + '/imagens/oxygen/22x22/Actions-office-chart-area-stacked-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="area_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'
  274 + + $trad(6, i3GEOF.graficointerativo1.dicionario)
  275 + + '</td></tr>'
  276 + + ' <tr><td>&nbsp;</td></tr>'
  277 + + ' <tr><td><img style=cursor:text; src="'
  278 + + locaplic
  279 + + '/imagens/oxygen/22x22/Actions-office-chart-scatter-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="ponto_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'
  280 + + $trad(7, i3GEOF.graficointerativo1.dicionario)
  281 + + '</td></tr>'
  282 + + ' <tr><td>&nbsp;</td></tr>'
  283 + + ' <tr><td><img style=cursor:text; src="'
  284 + + locaplic
  285 + + '/imagens/oxygen/22x22/Actions-office-chart-line-stacked-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="linha_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'
  286 + + $trad(8, i3GEOF.graficointerativo1.dicionario)
  287 + + '</td></tr>'
  288 + + ' <tr><td>&nbsp;</td></tr>'
  289 + + ' <tr><td><img style=cursor:text; src="'
  290 + + locaplic
  291 + + '/imagens/oxygen/22x22/Actions-office-chart-bar-icon-t.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="arvore_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'
  292 + + $trad(9, i3GEOF.graficointerativo1.dicionario)
  293 + + '</td></tr>'
  294 + + ' <tr><td>&nbsp;</td></tr>'
  295 + + ' <tr><td><img style=cursor:text; src="'
  296 + + locaplic
  297 + + '/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'
  298 + + $trad(10, i3GEOF.graficointerativo1.dicionario)
  299 + + '</td></tr>'
  300 + + ' <tr><td>&nbsp;</td></tr>'
  301 + + ' <tr><td><img style=cursor:text; src="'
  302 + + locaplic
  303 + + '/imagens/oxygen/22x22/Actions-office-chart-bar-icon-h.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_2" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'
  304 + + $trad(11, i3GEOF.graficointerativo1.dicionario)
  305 + + '</td></tr>'
  306 + + ' </table>'
  307 + + '</div> '
  308 + + '<div class=guiaobj id="i3GEOgraficointerativo1guia2obj" style="left:1px;display:none;top:-5px">'
  309 + + ' <p class=paragrafo >'
  310 + + $trad(12, i3GEOF.graficointerativo1.dicionario)
  311 + + ': </p>'
  312 + + ' <p class=paragrafo >'
  313 + + $trad(13, i3GEOF.graficointerativo1.dicionario)
  314 + + ':</p>'
  315 + + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboTemas ></div>'
  316 + + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboXlinha >'
  317 + + ' <p class=paragrafo >'
  318 + + $trad(14, i3GEOF.graficointerativo1.dicionario)
  319 + + ':</p>'
  320 + + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboX ></div>'
  321 + + ' </div>'
  322 + + ' <div id=i3GEOgraficointerativo1ComboYlinha style=display:block >'
  323 + + ' <p class=paragrafo >'
  324 + + $trad(15, i3GEOF.graficointerativo1.dicionario)
  325 + + ': </p>'
  326 + + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboY ></div>'
  327 + + ' </div>'
  328 + + ' <p class=paragrafo >'
  329 + + $trad(16, i3GEOF.graficointerativo1.dicionario)
  330 + + ': '
  331 + + $inputText("", "", "i3GEOgraficointerativo1excluir", "", 3,
  332 + "")
  333 + + ' <p class=paragrafo ><input type=checkbox style="cursor:pointer;top:3px;position:relative;" id=i3GEOgraficointerativo1CoresA /> '
  334 + + $trad(17, i3GEOF.graficointerativo1.dicionario)
  335 + + '</p>'
  336 + + ' <p class=paragrafo ><input id=i3GEOgraficointerativo1botao1 type="buttom" value="'
  337 + + $trad(18, i3GEOF.graficointerativo1.dicionario)
  338 + + '" /></p>'
  339 + + ' <div id=i3GEOgraficointerativo1Dados ></div>'
  340 + + ' <div class=paragrafo id=i3GEOgraficointerativo1AjudaPizza >'
  341 + + $trad(19, i3GEOF.graficointerativo1.dicionario)
  342 + + '</div>'
  343 + + '</div>'
  344 + + '<div class=guiaobj id="i3GEOgraficointerativo1guia3obj" style="left:1px;display:none;top:-5px">'
  345 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1xInclinado checked /> '
  346 + + $trad(20, i3GEOF.graficointerativo1.dicionario)
  347 + + '</p>'
  348 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1AdLinhas checked /> '
  349 + + $trad(21, i3GEOF.graficointerativo1.dicionario)
  350 + + '</p>'
  351 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1Acumula /> '
  352 + + $trad(22, i3GEOF.graficointerativo1.dicionario)
  353 + + '</p>'
  354 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1Relativa /> '
  355 + + $trad(23, i3GEOF.graficointerativo1.dicionario)
  356 + + ' (%)</p>'
  357 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1OrdenaX checked /> '
  358 + + $trad(24, i3GEOF.graficointerativo1.dicionario)
  359 + + '</p>'
  360 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1DadosPuros /> '
  361 + + $trad(25, i3GEOF.graficointerativo1.dicionario)
  362 + + '</p>'
  363 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOFgraficointerativo1ativaNavegacao onclick="i3GEOF.graficointerativo1.ativaNavegacao(this.checked)" /> '
  364 + + $trad(47, i3GEOF.graficointerativo1.dicionario)
  365 + + '</p>'
  366 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOFgraficointerativo1ativaStacked /> '
  367 + + $trad(48, i3GEOF.graficointerativo1.dicionario)
  368 + + '</p>'
  369 + + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOFgraficointerativo1ativaRowsInColumns /> '
  370 + + $trad(49, i3GEOF.graficointerativo1.dicionario)
  371 + + '</p>'
  372 +
  373 + + ' <p class=paragrafo ><select onchange="i3GEOF.graficointerativo1.obterDados()" id="i3GEOgraficointerativo1TipoAgregacao" ><option value="soma">'
  374 + + $trad(26, i3GEOF.graficointerativo1.dicionario)
  375 + + '</option><option value="media">'
  376 + + $trad(27, i3GEOF.graficointerativo1.dicionario)
  377 + + '</option></select> '
  378 + + $trad(28, i3GEOF.graficointerativo1.dicionario)
  379 + + '</p>'
  380 + + ' <p class=paragrafo ><input style=cursor:pointer;width:50px; value=40 type=text id=i3GEOgraficointerativo1FatorTamanho /> '
  381 + + $trad(29, i3GEOF.graficointerativo1.dicionario)
  382 + + '.</p>'
  383 + +
  384 +
  385 + '</div>'
  386 + + '<div class=guiaobj id="i3GEOgraficointerativo1guia4obj" style="left:1px;display:none;top:-10px">'
  387 + + ' <a href="#" onclick="i3GEOF.graficointerativo1.novaJanela()" >'
  388 + + $trad(30, i3GEOF.graficointerativo1.dicionario)
  389 + + '</a>'
  390 + + ' <div id=i3GEOgraficointerativo1guia4objCanvas ></div>'
  391 + + '</div>'
  392 + + '<div class=guiaobj id="i3GEOgraficointerativo1guia5obj" style="font-size:10px;left:10px;display:none;top:-0px">'
  393 + + '</div>'
  394 + + '<div id="i3GEOgraficointerativo1Grafico" style="position:relative;top:-5px;display:none"></div>';
  395 + return ins;
  396 + },
  397 + /*
  398 + * Function: iniciaJanelaFlutuante
  399 + *
  400 + * Cria a janela flutuante para controle da ferramenta.
  401 + *
  402 + * Parametro
  403 + *
  404 + * dados {JSON} - dados para o gr&aacute;fico
  405 + */
  406 + iniciaJanelaFlutuante : function(dados) {
  407 + if (dados) {
  408 + i3GEOF.graficointerativo1.dados = dados;
  409 + }
  410 + var minimiza, cabecalho, janela, divid, temp, titulo;
  411 + // cria a janela flutuante
  412 + cabecalho = function() {
205 413 i3GEOF.graficointerativo1.ativaFoco();
206   - i3GEOF.graficointerativo1.comboTemas();
207   - new YAHOO.widget.Button(
208   - "i3GEOgraficointerativo1botao1",
209   - {onclick:{fn: i3GEOF.graficointerativo1.obterDados}}
210   - );
211   - if(i3GEOF.graficointerativo1.dados && i3GEOF.graficointerativo1.dados != "undefined"){
212   - //i3GEOF.graficointerativo1.tipo = "pizza2d";
213   - //var retorno = {"attributes":{"id":""},"data":{"dados":["n;x","'4';3839572","'8';81710320","'7';24631314","'2';10967753","'1';24496400","'3';18752482","'5';13574480","'6';216507515"]}};
214   - i3GEOF.graficointerativo1.montaTabelaDados(i3GEOF.graficointerativo1.dados);
215   - $i("i3GEOgraficointerativo1guia4").onclick.call();
216   - }
217   - i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia");
218   - //}
219   - //catch(erro){i3GEO.janela.tempoMsg(erro);}
220   - },
221   - /*
222   - Function: html
223   -
224   - Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta
225   -
226   - Retorno:
227   -
228   - String com o c&oacute;digo html
229   - */
230   - html:function(){
231   - var locaplic = i3GEO.configura.locaplic,
232   - ins = '' +
233   - '<div id=i3GEOgraficointerativo1guiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">' +
234   - ' <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">' +
235   - ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia3" style="text-align:center;left:0px;" ><img class="ticPropriedades2" style="height:14px" title="'+$trad("p13")+'" src="'+i3GEO.configura.locaplic+'/imagens/visual/default/branco.gif"></div></em></a></li>' +
236   - ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia1" style="text-align:center;left:0px;" >'+$trad(1,i3GEOF.graficointerativo1.dicionario)+'</div></em></a></li>' +
237   - ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia2" style="text-align:center;left:0px;" >'+$trad(2,i3GEOF.graficointerativo1.dicionario)+'</div></em></a></li>' +
238   - ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia4" style="text-align:center;left:0px;" >'+$trad(3,i3GEOF.graficointerativo1.dicionario)+'</div></em></a></li>' +
239   - ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia5" style="text-align:center;left:0px;" >CSV</div></em></a></li>' +
240   - ' </ul>' +
241   - '</div><br>' +
242   - '<div class=guiaobj id="i3GEOgraficointerativo1guia1obj" style="left:1px;display:none;">' +
243   - ' <p class=paragrafo >'+$trad(4,i3GEOF.graficointerativo1.dicionario)+': </p>' +
244   - ' <table class=lista6 >' +
245   - ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-pie-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="pizza_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'+$trad(5,i3GEOF.graficointerativo1.dicionario)+'</td></tr>' +
246   - ' <tr><td>&nbsp;</td></tr>' +
247   - ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-area-stacked-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="area_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'+$trad(6,i3GEOF.graficointerativo1.dicionario)+'</td></tr>' +
248   - ' <tr><td>&nbsp;</td></tr>' +
249   - ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-scatter-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="ponto_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'+$trad(7,i3GEOF.graficointerativo1.dicionario)+'</td></tr>' +
250   - ' <tr><td>&nbsp;</td></tr>' +
251   - ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-line-stacked-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="linha_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'+$trad(8,i3GEOF.graficointerativo1.dicionario)+'</td></tr>' +
252   - ' <tr><td>&nbsp;</td></tr>' +
253   - ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon-t.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="arvore_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'+$trad(9,i3GEOF.graficointerativo1.dicionario)+'</td></tr>' +
254   - ' <tr><td>&nbsp;</td></tr>' +
255   - ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_1" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'+$trad(10,i3GEOF.graficointerativo1.dicionario)+'</td></tr>' +
256   - ' <tr><td>&nbsp;</td></tr>' +
257   - ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon-h.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_2" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>'+$trad(11,i3GEOF.graficointerativo1.dicionario)+'</td></tr>' +
258   - ' </table>' +
259   - '</div> ' +
260   - '<div class=guiaobj id="i3GEOgraficointerativo1guia2obj" style="left:1px;display:none;top:-5px">' +
261   - ' <p class=paragrafo >'+$trad(12,i3GEOF.graficointerativo1.dicionario)+': </p>' +
262   - ' <p class=paragrafo >'+$trad(13,i3GEOF.graficointerativo1.dicionario)+':</p>' +
263   - ' <div class=paragrafo id=i3GEOgraficointerativo1ComboTemas ></div>' +
264   - ' <div class=paragrafo id=i3GEOgraficointerativo1ComboXlinha >' +
265   - ' <p class=paragrafo >'+$trad(14,i3GEOF.graficointerativo1.dicionario)+':</p>' +
266   - ' <div class=paragrafo id=i3GEOgraficointerativo1ComboX ></div>' +
267   - ' </div>'+
268   - ' <div id=i3GEOgraficointerativo1ComboYlinha style=display:block >'+
269   - ' <p class=paragrafo >'+$trad(15,i3GEOF.graficointerativo1.dicionario)+': </p>'+
270   - ' <div class=paragrafo id=i3GEOgraficointerativo1ComboY ></div>' +
271   - ' </div>' +
272   - ' <p class=paragrafo >'+$trad(16,i3GEOF.graficointerativo1.dicionario)+': ' +
273   - $inputText("","","i3GEOgraficointerativo1excluir","",3,"") +
274   - ' <p class=paragrafo ><input type=checkbox style="cursor:pointer;top:3px;position:relative;" id=i3GEOgraficointerativo1CoresA /> '+$trad(17,i3GEOF.graficointerativo1.dicionario)+'</p>' +
275   - ' <p class=paragrafo ><input id=i3GEOgraficointerativo1botao1 type="buttom" value="'+$trad(18,i3GEOF.graficointerativo1.dicionario)+'" /></p>'+
276   - ' <div id=i3GEOgraficointerativo1Dados ></div>'+
277   - ' <div class=paragrafo id=i3GEOgraficointerativo1AjudaPizza >'+$trad(19,i3GEOF.graficointerativo1.dicionario)+'</div>' +
278   - '</div>' +
279   - '<div class=guiaobj id="i3GEOgraficointerativo1guia3obj" style="left:1px;display:none;top:-5px">' +
280   - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1xInclinado checked /> '+$trad(20,i3GEOF.graficointerativo1.dicionario)+'</p>' +
281   - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1AdLinhas checked /> '+$trad(21,i3GEOF.graficointerativo1.dicionario)+'</p>' +
282   - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1Acumula /> '+$trad(22,i3GEOF.graficointerativo1.dicionario)+'</p>' +
283   - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1Relativa /> '+$trad(23,i3GEOF.graficointerativo1.dicionario)+' (%)</p>' +
284   - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1OrdenaX checked /> '+$trad(24,i3GEOF.graficointerativo1.dicionario)+'</p>' +
285   - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1DadosPuros /> '+$trad(25,i3GEOF.graficointerativo1.dicionario)+'</p>' +
286   - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOFgraficointerativo1ativaNavegacao onclick="i3GEOF.graficointerativo1.ativaNavegacao(this.checked)" /> Atualiza o gr&aacute;fico ao navegar pelo mapa</p>' +
287   - ' <p class=paragrafo ><select onchange="i3GEOF.graficointerativo1.obterDados()" id="i3GEOgraficointerativo1TipoAgregacao" ><option value="soma">'+$trad(26,i3GEOF.graficointerativo1.dicionario)+'</option><option value="media">'+$trad(27,i3GEOF.graficointerativo1.dicionario)+'</option></select> '+$trad(28,i3GEOF.graficointerativo1.dicionario)+'</p>' +
288   - ' <p class=paragrafo ><input style=cursor:pointer;width:50px; value=40 type=text id=i3GEOgraficointerativo1FatorTamanho /> '+$trad(29,i3GEOF.graficointerativo1.dicionario)+'.</p>' +
289   -
290   - '</div>'+
291   - '<div class=guiaobj id="i3GEOgraficointerativo1guia4obj" style="left:1px;display:none;top:-10px">' +
292   - ' <a href="#" onclick="i3GEOF.graficointerativo1.novaJanela()" >'+$trad(30,i3GEOF.graficointerativo1.dicionario)+'</a>' +
293   - ' <div id=i3GEOgraficointerativo1guia4objCanvas ></div>' +
294   - '</div>' +
295   - '<div class=guiaobj id="i3GEOgraficointerativo1guia5obj" style="font-size:10px;left:10px;display:none;top:-0px">' +
296   - '</div>' +
297   - '<div id="i3GEOgraficointerativo1Grafico" style="position:relative;top:-5px;display:none"></div>';
298   - return ins;
299   - },
300   - /*
301   - Function: iniciaJanelaFlutuante
302   -
303   - Cria a janela flutuante para controle da ferramenta.
304   -
305   - Parametro
306   -
307   - dados {JSON} - dados para o gr&aacute;fico
308   - */
309   - iniciaJanelaFlutuante: function(dados){
310   - if(dados){
311   - i3GEOF.graficointerativo1.dados = dados;
312   - }
313   - var minimiza,cabecalho,janela,divid,temp,titulo;
314   - //cria a janela flutuante
315   - cabecalho = function(){
316   - i3GEOF.graficointerativo1.ativaFoco();
317   - };
318   - minimiza = function(){
319   - i3GEO.janela.minimiza("i3GEOF.graficointerativo1");
  414 + };
  415 + minimiza = function() {
  416 + i3GEO.janela.minimiza("i3GEOF.graficointerativo1");
  417 + };
  418 + titulo = "&nbsp;&nbsp;&nbsp;"
  419 + + $trad("t37b")
  420 + + " <a class=ajuda_usuario target=_blank href='"
  421 + + i3GEO.configura.locaplic
  422 + + "/ajuda_usuario.php?idcategoria=3&idajuda=84' >&nbsp;&nbsp;&nbsp;</a>";
  423 + janela = i3GEO.janela.cria("380px", "310px", "", "", "", titulo,
  424 + "i3GEOF.graficointerativo1", false, "hd", cabecalho, minimiza);
  425 + divid = janela[2].id;
  426 + i3GEOF.graficointerativo1.aguarde = $i("i3GEOF.graficointerativo1_imagemCabecalho").style;
  427 + $i("i3GEOF.graficointerativo1_corpo").style.backgroundColor = "white";
  428 + $i("i3GEOF.graficointerativo1_corpo").style.overflow = "auto";
  429 + i3GEOF.graficointerativo1.inicia(divid);
  430 + if (i3GEO.Interface) {
  431 + temp = function() {
  432 + if (i3GEO.Interface.ATUAL !== "googlemaps"
  433 + && i3GEO.Interface.ATUAL !== "googleearth") {
  434 + i3GEO.eventos.NAVEGAMAPA
  435 + .remove("i3GEOF.graficointerativo1.obterDados()");
  436 + }
  437 + if (i3GEO.Interface.ATUAL == "googlemaps") {
  438 + google.maps.event.removeListener(graficointerativo1Dragend);
  439 + google.maps.event.removeListener(graficointerativo1Zoomend);
  440 + }
  441 + if (i3GEO.Interface.ATUAL === "googleearth") {
  442 + google.earth.removeEventListener(graficointerativo1Dragend);
  443 + }
  444 + if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search(
  445 + "i3GEOF.graficointerativo1.comboTemas()") > 0) {
  446 + i3GEO.eventos.ATUALIZAARVORECAMADAS
  447 + .remove("i3GEOF.graficointerativo1.comboTemas()");
  448 + }
320 449 };
321   - titulo = "&nbsp;&nbsp;&nbsp;"+$trad("t37b")+" <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=84' >&nbsp;&nbsp;&nbsp;</a>";
322   - janela = i3GEO.janela.cria(
323   - "380px",
324   - "310px",
325   - "",
326   - "",
327   - "",
328   - titulo,
329   - "i3GEOF.graficointerativo1",
330   - false,
331   - "hd",
332   - cabecalho,
333   - minimiza
334   - );
335   - divid = janela[2].id;
336   - i3GEOF.graficointerativo1.aguarde = $i("i3GEOF.graficointerativo1_imagemCabecalho").style;
337   - $i("i3GEOF.graficointerativo1_corpo").style.backgroundColor = "white";
338   - $i("i3GEOF.graficointerativo1_corpo").style.overflow = "auto";
339   - i3GEOF.graficointerativo1.inicia(divid);
340   - if(i3GEO.Interface){
341   - temp = function(){
342   - if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){
343   - i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.obterDados()");
344   - }
345   - if(i3GEO.Interface.ATUAL == "googlemaps"){
346   - google.maps.event.removeListener(graficointerativo1Dragend);
347   - google.maps.event.removeListener(graficointerativo1Zoomend);
348   - }
349   - if(i3GEO.Interface.ATUAL === "googleearth"){
350   - google.earth.removeEventListener(graficointerativo1Dragend);
351   - }
352   - if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.graficointerativo1.comboTemas()") > 0)
353   - {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.graficointerativo1.comboTemas()");}
354   - };
355   - YAHOO.util.Event.addListener(janela[0].close, "click", temp);
356   - if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.graficointerativo1.comboTemas()") < 0)
357   - {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.graficointerativo1.comboTemas()");}
  450 + YAHOO.util.Event.addListener(janela[0].close, "click", temp);
  451 + if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search(
  452 + "i3GEOF.graficointerativo1.comboTemas()") < 0) {
  453 + i3GEO.eventos.ATUALIZAARVORECAMADAS
  454 + .push("i3GEOF.graficointerativo1.comboTemas()");
358 455 }
359   - },
360   - /*
361   - Function: ativaFoco
362   -
363   - Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado
364   - */
365   - ativaFoco: function(){
366   - if(i3GEO.Interface){
367   - i3GEO.barraDeBotoes.ativaIcone("graficointerativo1");
  456 + }
  457 + },
  458 + /*
  459 + * Function: ativaFoco
  460 + *
  461 + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco
  462 + * ativado
  463 + */
  464 + ativaFoco : function() {
  465 + if (i3GEO.Interface) {
  466 + i3GEO.barraDeBotoes.ativaIcone("graficointerativo1");
  467 + }
  468 + var i = $i("i3GEOF.graficointerativo1_c").style;
  469 + i3GEO.janela.ULTIMOZINDEX++;
  470 + i.zIndex = i3GEO.janela.ULTIMOZINDEX;
  471 + },
  472 + novaJanela : function() {
  473 + var janela = "", divid, g = $i("i3GEOgraficointerativo1guia4objCanvas"), v = g
  474 + .cloneNode(true), cabecalho = function() {
  475 + }, id = YAHOO.util.Dom.generateId(), minimiza = function() {
  476 + i3GEO.janela.minimiza(id);
  477 + }, titulo = "&nbsp;&nbsp;&nbsp;" + i3GEOF.graficointerativo1.titulo;
  478 + janela = i3GEO.janela.cria("380px", "280px", "", "", "", titulo, id,
  479 + false, "hd", cabecalho, minimiza);
  480 + divid = janela[2].id;
  481 + $i(divid).style.marginTop = "0px";
  482 + v.id = id + "ngrafico";
  483 + v.style.marginTop = "0px";
  484 + $i(divid).appendChild(v);
  485 + },
  486 + /*
  487 + * Function: comboTemas
  488 + *
  489 + * Monta o combo para escolha do tema que ser&aacute; utilizado no
  490 + * gr&aacute;fico
  491 + */
  492 + comboTemas : function() {
  493 + if (!i3GEO.Interface) {
  494 + return;
  495 + }
  496 + i3GEO.util
  497 + .comboTemas(
  498 + "i3GEOgraficointerativo1ComboTemasId",
  499 + function(retorno) {
  500 + $i("i3GEOgraficointerativo1ComboTemas").innerHTML = retorno.dados;
  501 + $i("i3GEOgraficointerativo1ComboTemas").style.display = "block";
  502 + if ($i("i3GEOgraficointerativo1ComboTemasId")) {
  503 + $i("i3GEOgraficointerativo1ComboTemasId").onchange = function() {
  504 + i3GEO.mapa
  505 + .ativaTema($i("i3GEOgraficointerativo1ComboTemasId").value);
  506 + i3GEOF.graficointerativo1.comboItensSel();
  507 + };
  508 + }
  509 + if (i3GEO.temaAtivo !== "") {
  510 + $i("i3GEOgraficointerativo1ComboTemasId").value = i3GEO.temaAtivo;
  511 + $i("i3GEOgraficointerativo1ComboTemasId").onchange
  512 + .call();
  513 + }
  514 + }, "i3GEOgraficointerativo1ComboTemas", "", false,
  515 + "ligados", "font-size:12px;width:350px");
  516 + },
  517 + /*
  518 + * Function: ativaTipo
  519 + *
  520 + * Define a vari&aacute;vel com o tipo de gr&aacute;fico e mostra a guia 2
  521 + */
  522 + ativaTipo : function(obj) {
  523 + i3GEOF.graficointerativo1.tipo = obj.value;
  524 + if ($i("i3GEOgraficointerativo1Grafico").innerHTML === ""
  525 + || $i("i3GEOgraficointerativo1tabeladados").innerHTML == "") {
  526 + $i("i3GEOgraficointerativo1guia2").onclick.call();
  527 + } else {
  528 + $i("i3GEOgraficointerativo1guia4").onclick.call();
  529 + }
  530 + },
  531 + /*
  532 + * Function: configuraDados
  533 + *
  534 + * Configura o formul&aacute;rio para obten&ccedil;&atilde;o dos dados para
  535 + * cada tipo de gr&aacute;fico
  536 + */
  537 + configuraDados : function() {
  538 + var ativa = function(comboxlinha, comboylinha, ajudapizza) {
  539 + try {
  540 + $i("i3GEOgraficointerativo1ComboXlinha").style.display = comboxlinha;
  541 + $i("i3GEOgraficointerativo1ComboYlinha").style.display = comboylinha;
  542 + $i("i3GEOgraficointerativo1AjudaPizza").style.display = ajudapizza;
  543 + } catch (e) {
368 544 }
369   - var i = $i("i3GEOF.graficointerativo1_c").style;
370   - i3GEO.janela.ULTIMOZINDEX++;
371   - i.zIndex = i3GEO.janela.ULTIMOZINDEX;
372   - },
373   - novaJanela: function(){
374   - var janela = "",
375   - divid,
376   - g = $i("i3GEOgraficointerativo1guia4objCanvas"),
377   - v = g.cloneNode(true),
378   - cabecalho = function(){},
379   - id = YAHOO.util.Dom.generateId(),
380   - minimiza = function(){
381   - i3GEO.janela.minimiza(id);
382   - },
383   - titulo = "&nbsp;&nbsp;&nbsp;"+i3GEOF.graficointerativo1.titulo;
384   - janela = i3GEO.janela.cria(
385   - "380px",
386   - "280px",
387   - "",
388   - "",
389   - "",
390   - titulo,
391   - id,
392   - false,
393   - "hd",
394   - cabecalho,
395   - minimiza
396   - );
397   - divid = janela[2].id;
398   - $i(divid).style.marginTop = "0px";
399   - v.id = id+"ngrafico";
400   - v.style.marginTop = "0px";
401   - $i(divid).appendChild(v);
402   - },
403   - /*
404   - Function: comboTemas
405   -
406   - Monta o combo para escolha do tema que ser&aacute; utilizado no gr&aacute;fico
407   - */
408   - comboTemas: function(){
409   - if(!i3GEO.Interface){return;}
410   - i3GEO.util.comboTemas(
411   - "i3GEOgraficointerativo1ComboTemasId",
412   - function(retorno){
413   - $i("i3GEOgraficointerativo1ComboTemas").innerHTML = retorno.dados;
414   - $i("i3GEOgraficointerativo1ComboTemas").style.display = "block";
415   - if ($i("i3GEOgraficointerativo1ComboTemasId")){
416   - $i("i3GEOgraficointerativo1ComboTemasId").onchange = function(){
417   - i3GEO.mapa.ativaTema($i("i3GEOgraficointerativo1ComboTemasId").value);
418   - i3GEOF.graficointerativo1.comboItensSel();
419   - };
420   - }
421   - if(i3GEO.temaAtivo !== ""){
422   - $i("i3GEOgraficointerativo1ComboTemasId").value = i3GEO.temaAtivo;
423   - $i("i3GEOgraficointerativo1ComboTemasId").onchange.call();
424   - }
425   - },
426   - "i3GEOgraficointerativo1ComboTemas",
427   - "",
428   - false,
429   - "ligados",
430   - "font-size:12px;width:350px"
431   - );
432   - },
433   - /*
434   - Function: ativaTipo
435   -
436   - Define a vari&aacute;vel com o tipo de gr&aacute;fico e mostra a guia 2
437   - */
438   - ativaTipo: function(obj){
439   - i3GEOF.graficointerativo1.tipo = obj.value;
440   - if($i("i3GEOgraficointerativo1Grafico").innerHTML === "" || $i("i3GEOgraficointerativo1tabeladados").innerHTML == "")
441   - {$i("i3GEOgraficointerativo1guia2").onclick.call();}
442   - else
443   - {$i("i3GEOgraficointerativo1guia4").onclick.call();}
444   - },
445   - /*
446   - Function: configuraDados
447   -
448   - Configura o formul&aacute;rio para obten&ccedil;&atilde;o dos dados para cada tipo de gr&aacute;fico
449   - */
450   - configuraDados: function(){
451   - var ativa = function(comboxlinha,comboylinha,ajudapizza){
452   - try{
453   - $i("i3GEOgraficointerativo1ComboXlinha").style.display = comboxlinha;
454   - $i("i3GEOgraficointerativo1ComboYlinha").style.display = comboylinha;
455   - $i("i3GEOgraficointerativo1AjudaPizza").style.display = ajudapizza;
456   - }catch(e){}
457   - };
458   - if (i3GEOF.graficointerativo1.tipo === ""){
459   - i3GEO.janela.tempoMsg($trad(31,i3GEOF.graficointerativo1.dicionario));
460   - i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia");
461   - return;
  545 + };
  546 + if (i3GEOF.graficointerativo1.tipo === "") {
  547 + i3GEO.janela.tempoMsg($trad(31,
  548 + i3GEOF.graficointerativo1.dicionario));
  549 + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
  550 + "i3GEOgraficointerativo1guia");
  551 + return;
  552 + }
  553 + if (i3GEOF.graficointerativo1.tipo === "pizza2d") {
  554 + ativa.call("block", "block", "block");
  555 + }
  556 + },
  557 + /*
  558 + * Function: comboItensSel
  559 + *
  560 + * Cria um combo para selecionar os itens do tema escolhido
  561 + *
  562 + * Veja:
  563 + *
  564 + * <i3GEO.util.comboItens>
  565 + */
  566 + comboItensSel : function() {
  567 + var tema = $i("i3GEOgraficointerativo1ComboTemasId").value;
  568 + i3GEO.util
  569 + .comboItens(
  570 + "i3GEOgraficointerativo1ComboXid",
  571 + tema,
  572 + function(retorno) {
  573 + if (retorno.tipo === "erro") {
  574 + $i("i3GEOgraficointerativo1ComboX").innerHTML = "<br><br><span style='color:red'>"
  575 + + $trad(
  576 + 32,
  577 + i3GEOF.graficointerativo1.dicionario)
  578 + + "</span><br><br>";
  579 + $i("i3GEOgraficointerativo1ComboY").innerHTML = "<br><br><span style='color:red'>"
  580 + + $trad(
  581 + 32,
  582 + i3GEOF.graficointerativo1.dicionario)
  583 + + "</span><br><br>";
  584 + } else {
  585 + $i("i3GEOgraficointerativo1ComboY").innerHTML = "<div>"
  586 + + retorno.dados
  587 + + "&nbsp;<input title='"
  588 + + $trad(
  589 + 33,
  590 + i3GEOF.graficointerativo1.dicionario)
  591 + + "' class=digitar type=text size=20 id=i3GEOgraficointerativo1ComboYidTitulo value='' /></div>";
  592 + $i("i3GEOgraficointerativo1ComboXid").id = "i3GEOgraficointerativo1ComboYid";
  593 + $i("i3GEOgraficointerativo1ComboX").innerHTML = "<div>"
  594 + + retorno.dados
  595 + + "&nbsp;<input title='"
  596 + + $trad(
  597 + 33,
  598 + i3GEOF.graficointerativo1.dicionario)
  599 + + "' class=digitar type=text size=20 id=i3GEOgraficointerativo1ComboXidTitulo value='' /></div>";
  600 + $i("i3GEOgraficointerativo1ComboXid").style.width = "160px";
  601 + $i("i3GEOgraficointerativo1ComboYid").style.width = "160px";
  602 +
  603 + $i("i3GEOgraficointerativo1ComboXid").onchange = function() {
  604 + $i(this.id + "Titulo").value = this.options[this.selectedIndex].label;
  605 + };
  606 + var adicionaFilho = function() {
  607 + var no = document.createElement("div"), tit = $i(this.id
  608 + + "Titulo"), novoselect;
  609 + if (tit) {
  610 + tit.value = this.options[this.selectedIndex].label;
  611 + }
  612 + no.innerHTML = retorno.dados + "<br>";
  613 + novoselect = no.getElementsByTagName("select")[0];
  614 + novoselect.id = "";
  615 + novoselect.onchange = adicionaFilho;
  616 + novoselect.style.width = "160px";
  617 + $i("i3GEOgraficointerativo1ComboY").appendChild(no);
  618 + };
  619 + $i("i3GEOgraficointerativo1ComboYid").onchange = adicionaFilho;
  620 + }
  621 + }, "i3GEOgraficointerativo1ComboX", "");
  622 + },
  623 + /*
  624 + * Function: obterDados
  625 + *
  626 + * Obt&eacute;m os dados que ser&atilde;o utilizados no gr&aacute;fico
  627 + *
  628 + * Veja:
  629 + *
  630 + * <GRAFICOSELECAO>
  631 + */
  632 + obterDados : function() {
  633 + if (!i3GEO.Interface) {
  634 + return;
  635 + }
  636 + if (i3GEOF.graficointerativo1.aguarde.visibility === "visible") {
  637 + return;
  638 + }
  639 + var tema = $i("i3GEOgraficointerativo1ComboTemasId").value, excluir = $i("i3GEOgraficointerativo1excluir").value, cp = new cpaint(), tipo = $i("i3GEOgraficointerativo1TipoAgregacao").value, ordenax = "sim", monta, p, x, y, i, n, temp;
  640 +
  641 + // pega os itens
  642 + temp = $i("i3GEOgraficointerativo1ComboX");
  643 + x = temp.getElementsByTagName("select")[0].value;
  644 + temp = $i("i3GEOgraficointerativo1ComboY");
  645 + temp = temp.getElementsByTagName("select");
  646 + n = temp.length;
  647 + if (n === 1) {
  648 + y = temp[0].value;
  649 + } else {
  650 + y = [];
  651 + for (i = 0; i < n; i++) {
  652 + if (temp[i].value != "") {
  653 + y.push(temp[i].value);
  654 + }
462 655 }
463   - if(i3GEOF.graficointerativo1.tipo === "pizza2d"){
464   - ativa.call("block","block","block");
  656 + y = y.join(",");
  657 + }
  658 + p = i3GEO.configura.locaplic
  659 + + "/ferramentas/graficointerativo1/exec.php?g_sid="
  660 + + i3GEO.configura.sid + "&funcao=graficoSelecao&tema=" + tema
  661 + + "&itemclasses=" + x + "&itemvalores=" + y + "&exclui="
  662 + + excluir + "&ext=" + i3GEO.parametros.mapexten;
  663 +
  664 + if ($i("i3GEOgraficointerativo1DadosPuros").checked) {
  665 + tipo = "nenhum";
  666 + } else {
  667 + if (x === y) {
  668 + tipo = "conta";
465 669 }
466   - },
467   - /*
468   - Function: comboItensSel
469   -
470   - Cria um combo para selecionar os itens do tema escolhido
471   -
472   - Veja:
473   -
474   - <i3GEO.util.comboItens>
475   - */
476   - comboItensSel: function(){
477   - var tema = $i("i3GEOgraficointerativo1ComboTemasId").value;
478   - i3GEO.util.comboItens(
479   - "i3GEOgraficointerativo1ComboXid",
480   - tema,
481   - function(retorno){
482   - if(retorno.tipo === "erro"){
483   - $i("i3GEOgraficointerativo1ComboX").innerHTML = "<br><br><span style='color:red'>"+$trad(32,i3GEOF.graficointerativo1.dicionario)+"</span><br><br>";
484   - $i("i3GEOgraficointerativo1ComboY").innerHTML = "<br><br><span style='color:red'>"+$trad(32,i3GEOF.graficointerativo1.dicionario)+"</span><br><br>";
485   - }
486   - else{
487   - $i("i3GEOgraficointerativo1ComboY").innerHTML = retorno.dados + "&nbsp;<input title='"+$trad(33,i3GEOF.graficointerativo1.dicionario)+"' class=digitar type=text size=20 id=i3GEOgraficointerativo1ComboYidTitulo value='' />";
488   - $i("i3GEOgraficointerativo1ComboXid").id = "i3GEOgraficointerativo1ComboYid";
489   - $i("i3GEOgraficointerativo1ComboX").innerHTML = retorno.dados + "&nbsp;<input title='"+$trad(33,i3GEOF.graficointerativo1.dicionario)+"' class=digitar type=text size=20 id=i3GEOgraficointerativo1ComboXidTitulo value='' />";
490   - $i("i3GEOgraficointerativo1ComboXid").style.width = "160px";
491   - $i("i3GEOgraficointerativo1ComboYid").style.width = "160px";
492   - $i("i3GEOgraficointerativo1ComboXid").onchange = function(){
493   - var combo = $i("i3GEOgraficointerativo1ComboXid");
494   - $i("i3GEOgraficointerativo1ComboXidTitulo").value = combo.options[combo.selectedIndex].label;
495   - };
496   - $i("i3GEOgraficointerativo1ComboYid").onchange = function(){
497   - var combo = $i("i3GEOgraficointerativo1ComboYid");
498   - $i("i3GEOgraficointerativo1ComboYidTitulo").value = combo.options[combo.selectedIndex].label;
499   - };
500   - }
501   - },
502   - "i3GEOgraficointerativo1ComboX",
503   - ""
504   - );
505   - },
506   - /*
507   - Function: obterDados
508   -
509   - Obt&eacute;m os dados que ser&atilde;o utilizados no gr&aacute;fico
510   -
511   - Veja:
  670 + }
  671 + if (!$i("i3GEOgraficointerativo1OrdenaX").checked) {
  672 + ordenax = "nao";
  673 + }
512 674  
513   - <GRAFICOSELECAO>
514   - */
515   - obterDados: function(){
516   - if(!i3GEO.Interface){
517   - return;
  675 + if (tema === "") {
  676 + i3GEO.janela.tempoMsg($trad(34,
  677 + i3GEOF.graficointerativo1.dicionario));
  678 + return;
  679 + }
  680 + if (x === "") {
  681 + i3GEO.janela.tempoMsg($trad(35,
  682 + i3GEOF.graficointerativo1.dicionario));
  683 + return;
  684 + }
  685 + if (y === "") {
  686 + i3GEO.janela.tempoMsg($trad(36,
  687 + i3GEOF.graficointerativo1.dicionario));
  688 + return;
  689 + }
  690 + monta = function(retorno) {
  691 + i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
  692 + i3GEOF.graficointerativo1.montaTabelaDados(retorno);
  693 + $i("i3GEOgraficointerativo1guia4").onclick.call();
  694 + // verifica para nao ficar mostrando a janela toda vez que redesenha
  695 + // o mapa
  696 + if ($i("i3GEOFgraficointerativo1ativaNavegacao").checked == false) {
  697 + i3GEO.janela.tempoMsg($trad(37,
  698 + i3GEOF.graficointerativo1.dicionario));
518 699 }
519   - if(i3GEOF.graficointerativo1.aguarde.visibility === "visible")
520   - {return;}
521   - var tema = $i("i3GEOgraficointerativo1ComboTemasId").value,
522   - x = $i("i3GEOgraficointerativo1ComboXid").value,
523   - y = $i("i3GEOgraficointerativo1ComboYid").value,
524   - excluir = $i("i3GEOgraficointerativo1excluir").value,
525   - p = i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=graficoSelecao&tema="+tema+"&itemclasses="+x+"&itemvalores="+y+"&exclui="+excluir+"&ext="+i3GEO.parametros.mapexten,
526   - cp = new cpaint(),
527   - tipo = $i("i3GEOgraficointerativo1TipoAgregacao").value,
528   - ordenax = "sim",
529   - monta;
530   -
531   - if($i("i3GEOgraficointerativo1DadosPuros").checked)
532   - {tipo = "nenhum";}
533   - else{
534   - if(x === y)
535   - {tipo = "conta";}
  700 + };
  701 + i3GEOF.graficointerativo1.aguarde.visibility = "visible";
  702 + cp.set_response_type("JSON");
  703 + cp.call(p + "&tipo=" + tipo + "&ordenax=" + ordenax, "graficoSelecao",
  704 + monta);
  705 + },
  706 + /*
  707 + * Pega os nomes das colunas
  708 + */
  709 + nomesColunas: function(){
  710 + //pega os nomes das clunas
  711 + var i,n,
  712 + temp = $i("i3GEOgraficointerativo1ComboX"),
  713 + colunas = [];
  714 + colunas.push(temp.getElementsByTagName("select")[0].value);
  715 + temp = $i("i3GEOgraficointerativo1ComboY");
  716 + temp = temp.getElementsByTagName("select");
  717 + n = temp.length;
  718 + for(i=0;i<n;i++){
  719 + if(temp[i].value != ""){
  720 + colunas.push(temp[i].value);
536 721 }
537   - if(!$i("i3GEOgraficointerativo1OrdenaX").checked)
538   - {ordenax = "nao";}
539   -
540   - if(tema === "")
541   - {i3GEO.janela.tempoMsg($trad(34,i3GEOF.graficointerativo1.dicionario));return;}
542   - if(x === "")
543   - {i3GEO.janela.tempoMsg($trad(35,i3GEOF.graficointerativo1.dicionario));return;}
544   - if(y === "")
545   - {i3GEO.janela.tempoMsg($trad(36,i3GEOF.graficointerativo1.dicionario));return;}
546   - monta = function(retorno){
547   - i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
548   - i3GEOF.graficointerativo1.montaTabelaDados(retorno);
549   - $i("i3GEOgraficointerativo1guia4").onclick.call();
550   - //verifica para nao ficar mostrando a janela toda vez que redesenha o mapa
551   - if($i("i3GEOFgraficointerativo1ativaNavegacao").checked == false){
552   - i3GEO.janela.tempoMsg($trad(37,i3GEOF.graficointerativo1.dicionario));
553   - }
554   - };
555   - i3GEOF.graficointerativo1.aguarde.visibility = "visible";
556   - cp.set_response_type("JSON");
557   - cp.call(p+"&tipo="+tipo+"&ordenax="+ordenax,"graficoSelecao",monta);
558   - },
559   - /*
560   - Function: montaTabelaDados
561   -
562   - Monta a tabela com os dados que ser&atilde;o utilizados no gr&aacute;fico
563   -
564   - Parametro:
565   -
566   - retorno {JSON} - dados no formato JSON
567   - */
568   - montaTabelaDados: function(retorno){
569   - var dados,
  722 + }
  723 + return colunas;
  724 + },
  725 + /*
  726 + * Function: montaTabelaDados
  727 + *
  728 + * Monta a tabela com os dados que ser&atilde;o utilizados no gr&aacute;fico
  729 + *
  730 + * Parametro:
  731 + *
  732 + * retorno {JSON} - dados no formato JSON
  733 + */
  734 + montaTabelaDados : function(retorno) {
  735 + var colunas = [],
  736 + ncolunas,
  737 + dados,
570 738 n,
571 739 v,
572 740 ins = [],
573 741 i,
  742 + j,
574 743 id,
575 744 cor = "#C11515";
576   - if(!retorno.dados && retorno.data != undefined)
577   - {dados = retorno.data.dados;}
578   - else
579   - {dados = retorno;}
580   - n = dados.length;
581   - ins.push("<p class=paragrafo >"+$trad(38,i3GEOF.graficointerativo1.dicionario)+"</p><table class=lista4 id=i3GEOgraficointerativo1tabeladados ><tr><td></td>");
582   - ins.push("<td style=background-color:yellow >&nbsp;<img style=cursor:pointer onclick='i3GEOF.graficointerativo1.ordenaColuna(this,1)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> "+$trad(39,i3GEOF.graficointerativo1.dicionario)+"</td>");
583   - ins.push("<td style=background-color:yellow >&nbsp;<img style=cursor:pointer onclick='i3GEOF.graficointerativo1.ordenaColuna(this,2)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> "+$trad(40,i3GEOF.graficointerativo1.dicionario)+"</td>");
584   - ins.push("<td style=background-color:yellow >"+$trad(41,i3GEOF.graficointerativo1.dicionario)+"</td><td></td></tr>");
585   - for (i=1;i<n; i++){
586   - v = dados[i].split(";");
587   - v[0] = v[0].replace("'","");
588   - v[0] = v[0].replace("'","");
589   - //ins += v[0]+" "+v[1];
590   - id = "i3GEOgraficointerativo1Dados"+i; //layer+indice da classe
591   - ins.push("<tr><td>");
592   - ins.push("<img style='cursor:pointer' onclick='i3GEOF.graficointerativo1.excluilinha(this)' src='"+i3GEO.configura.locaplic+"/imagens/x.gif' title='"+$trad(42,i3GEOF.graficointerativo1.dicionario)+"' /></td>");
593   - ins.push("</td><td>");
594   - ins.push($inputText("","",id+"_nome",$trad(43,i3GEOF.graficointerativo1.dicionario),20,v[0],"nome"));
595   - ins.push("</td><td>");
596   - ins.push($inputText("","",id+"_valor",$trad(44,i3GEOF.graficointerativo1.dicionario),12,v[1],"valor"));
597   - ins.push("</td><td>");
598   - if($i("i3GEOgraficointerativo1CoresA").checked){
599   - cor = i3GEO.util.rgb2hex(i3GEO.util.randomRGB());
600   - }
601   - //verifica se no objeto com os dados existe um terceiro valor com as cores
602   - if(v[2]){
603   - cor = i3GEO.util.rgb2hex(v[2]);
604   - }
605   - ins.push($inputText("","",id+"_cor","",12,cor,$trad(41,i3GEOF.graficointerativo1.dicionario)));
606   - ins.push("</td><td>");
607   - ins.push("<img alt='aquarela.gif' style=cursor:pointer src='"+i3GEO.configura.locaplic+"/imagens/aquarela.gif' onclick='i3GEOF.graficointerativo1.corj(\""+id+"_cor\")' />");
608   - ins.push("</td></tr>");
  745 + if (!retorno.dados && retorno.data != undefined) {
  746 + dados = retorno.data.dados;
  747 + } else {
  748 + dados = retorno;
  749 + }
  750 + ins.push("<p class=paragrafo >"
  751 + + $trad(38, i3GEOF.graficointerativo1.dicionario)
  752 + + "</p><table class=lista4 id=i3GEOgraficointerativo1tabeladados ><tr><td></td>");
  753 + //pega os nomes das clunas
  754 + colunas = i3GEOF.graficointerativo1.nomesColunas();
  755 + ncolunas = colunas.length;
  756 + for(i=0;i<ncolunas;i++){
  757 + ins.push("<td style=background-color:yellow >&nbsp;<img style=cursor:pointer onclick='i3GEOF.graficointerativo1.ordenaColuna(this,1)' src='"
  758 + + i3GEO.configura.locaplic
  759 + + "/imagens/ordena1.gif' title='ordena' /> "
  760 + + colunas[i]
  761 + + "</td>");
  762 + }
  763 + ins.push("<td style=background-color:yellow >"
  764 + + $trad(41, i3GEOF.graficointerativo1.dicionario)
  765 + + "</td><td></td></tr>");
  766 + n = dados.length;
  767 + for (i = 1; i < n; i++) {
  768 + v = dados[i].split(";");
  769 + // ins += v[0]+" "+v[1];
  770 + id = "i3GEOgraficointerativo1Dados" + i; // layer+indice da classe
  771 + ins.push("<tr><td>");
  772 + ins.push("<img style='cursor:pointer' onclick='i3GEOF.graficointerativo1.excluilinha(this)' src='"
  773 + + i3GEO.configura.locaplic
  774 + + "/imagens/x.gif' title='"
  775 + + $trad(42, i3GEOF.graficointerativo1.dicionario)
  776 + + "' /></td>");
  777 + ins.push("</td>");
  778 + for(j=0;j<ncolunas;j++){
  779 + v[j] = v[j].replace("'", "");
  780 + v[j] = v[j].replace("'", "");
  781 + ins.push("<td>");
  782 + ins.push($inputText("", "", id + colunas[j], $trad(43,
  783 + i3GEOF.graficointerativo1.dicionario), 20, v[j], colunas[j]));
  784 + ins.push("</td>");
609 785 }
610   - ins.push("</table><br>");
611   - $i("i3GEOgraficointerativo1Dados").innerHTML = ins.join("");
612   - },
613   - /*
614   - Function: tabela2csv
615 786  
616   - Obt&eacute;m os dados da tabela em CSV
617   - */
618   - tabela2csv: function(){
619   - var inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"),
  787 + ins.push("<td>");
  788 + if ($i("i3GEOgraficointerativo1CoresA").checked) {
  789 + cor = i3GEO.util.rgb2hex(i3GEO.util.randomRGB());
  790 + }
  791 + // verifica se no objeto com os dados existe um terceiro valor com
  792 + // as cores
  793 + if (v[ncolunas + 1]) {
  794 + cor = i3GEO.util.rgb2hex(v[ncolunas + 1]);
  795 + }
  796 + ins.push($inputText("", "", id + "_cor", "", 12, cor, $trad(41,
  797 + i3GEOF.graficointerativo1.dicionario)));
  798 + ins.push("</td><td>");
  799 + ins.push("<img alt='aquarela.gif' style=cursor:pointer src='"
  800 + + i3GEO.configura.locaplic
  801 + + "/imagens/aquarela.gif' onclick='i3GEOF.graficointerativo1.corj(\""
  802 + + id + "_cor\")' />");
  803 + ins.push("</td></tr>");
  804 + }
  805 + ins.push("</table><br>");
  806 + $i("i3GEOgraficointerativo1Dados").innerHTML = ins.join("");
  807 + },
  808 + /*
  809 + * Function: tabela2csv
  810 + *
  811 + * Obt&eacute;m os dados da tabela em CSV
  812 + */
  813 + tabela2csv : function() {
  814 + var inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"),
620 815 ninputs = inputs.length,
621 816 i,
622 817 legendaX = "",
623 818 legendaY = "",
624 819 csv = [];
625   - if($i("i3GEOgraficointerativo1ComboXid"))
626   - {legendaX = $i("i3GEOgraficointerativo1ComboXid").value;}
627   - if($i("i3GEOgraficointerativo1ComboYid"))
628   - {legendaY = $i("i3GEOgraficointerativo1ComboYid").value;}
629   - csv.push(legendaX+";"+legendaY);
630   - for(i=0;i<ninputs;i = i + 3){
631   - csv.push(inputs[i].value+";"+inputs[i+1].value * 1);
632   - }
633   - return csv;
634   - },
635   - /*
636   - Function: tabela2dados
637   -
638   - Obt&eacute;m os dados da tabela para compor o gr&aacute;fico
639   - */
640   - tabela2dados: function(){
641   - if(i3GEOF.graficointerativo1.aguarde.visibility === "visible")
642   - {return;}
643   - i3GEOF.graficointerativo1.aguarde.visibility = "visible";
644   - var temp = 0,
  820 + if ($i("i3GEOgraficointerativo1ComboXid")) {
  821 + legendaX = $i("i3GEOgraficointerativo1ComboXid").value;
  822 + }
  823 + if ($i("i3GEOgraficointerativo1ComboYid")) {
  824 + legendaY = $i("i3GEOgraficointerativo1ComboYid").value;
  825 + }
  826 + csv.push(legendaX + ";" + legendaY);
  827 + for (i = 0; i < ninputs; i = i + 3) {
  828 + csv.push(inputs[i].value + ";" + inputs[i + 1].value * 1);
  829 + }
  830 + return csv;
  831 + },
  832 + /*
  833 + * Function: tabela2dados
  834 + *
  835 + * Obt&eacute;m os dados da tabela para compor o gr&aacute;fico
  836 + */
  837 + tabela2dados : function() {
  838 + if (i3GEOF.graficointerativo1.aguarde.visibility === "visible") {
  839 + return;
  840 + }
  841 + i3GEOF.graficointerativo1.aguarde.visibility = "visible";
  842 + var colunas = i3GEOF.graficointerativo1.nomesColunas(),
  843 + ncolunas = colunas.length,
  844 + temp = 0,
645 845 ultimo = 0,
646 846 inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"),
647 847 ninputs = inputs.length,
648   - n,
649   - i,
650   - parametros = [],
651   - valores = [],
652   - valoresS = [],
653   - acumulado = [],
654   - acum,
655   - nomes = [],
656   - cores = [],
657   - titulo = "",
658   - par = [],
659   - parcor = [],
660   - soma = 0,
661   - total = 0,
662   - menor = inputs[1].value * 1,
663   - maior = 0,
664   - menorNome = inputs[0].value * 1,
665   - maiorNome = 0,
666   - alpha = 0.8,
667   - stroke = 2,
668   - gradient = true,
669   - tituloSize = "15px",
670   - tituloCor = "#000000",
671   - tituloAlinhamento = "center",
672   - corunica = "#C11515",
673   - outlinecolor = "#577261",
674   - corGrid = "#D7E4A3",
675   - divisoesY = 10,
676   - rotacaoX = 270,
677   - legendaX = "",
678   - legendaY = "",
679   - fill = "#C4B86A",
680   - pointSize = 4,
681   - metadata = [],
682   - dados = {},
683   - xInclinado = $i("i3GEOgraficointerativo1xInclinado").checked;
684   - if($i("i3GEOgraficointerativo1ComboTemasId")){
685   - titulo = $i("i3GEOgraficointerativo1ComboTemasId").options[$i("i3GEOgraficointerativo1ComboTemasId").options.selectedIndex].text;
686   - }
687   - if(i3GEOF.graficointerativo1.titulo != "")
688   - {titulo = i3GEOF.graficointerativo1.titulo;}
689   - if($i("i3GEOgraficointerativo1ComboXid"))
690   - {legendaX = $i("i3GEOgraficointerativo1ComboXidTitulo").value;}
691   - if($i("i3GEOgraficointerativo1ComboYid"))
692   - {legendaY = $i("i3GEOgraficointerativo1ComboYidTitulo").value;}
693   - for(i=0;i<ninputs;i = i + 3){
694   - temp = inputs[i+1].value * 1;
  848 + tipoColuna = "String",
  849 + metadados = [],
  850 + i,j,
  851 + acumulado = [], acum, cores = [], par = [], total = 0, menor = inputs[1].value * 1, maior = 0, legendaX = "", legendaY = "", dados = {}, xInclinado = $i("i3GEOgraficointerativo1xInclinado").checked;
  852 + if ($i("i3GEOgraficointerativo1ComboTemasId")) {
  853 + titulo = $i("i3GEOgraficointerativo1ComboTemasId").options[$i("i3GEOgraficointerativo1ComboTemasId").options.selectedIndex].text;
  854 + }
  855 + if (i3GEOF.graficointerativo1.titulo != "") {
  856 + titulo = i3GEOF.graficointerativo1.titulo;
  857 + }
  858 + if ($i("i3GEOgraficointerativo1ComboXid")) {
  859 + legendaX = $i("i3GEOgraficointerativo1ComboXidTitulo").value;
  860 + }
  861 + if ($i("i3GEOgraficointerativo1ComboYid")) {
  862 + legendaY = $i("i3GEOgraficointerativo1ComboYidTitulo").value;
  863 + }
  864 + if(ncolunas === 2){
  865 + for (i = 0; i < ninputs; i = i + 3) {
  866 + temp = inputs[i + 1].value * 1;
695 867 total += temp;
  868 + cores.push(inputs[i + 2].value);
696 869 }
697   - for(i=0;i<ninputs;i = i + 3){
698   - //nomes.push(inputs[i].value+" ");
699   - cores.push(inputs[i+2].value);
700   - temp = inputs[i+1].value * 1;
701   - //valores.push(temp);
702   - //valoresS.push(temp+" ");
  870 + for (i = 0; i < ninputs; i = (i + 1 + ncolunas)) {
  871 + temp = inputs[i + 1].value * 1;
703 872 acum = ultimo + temp;
704 873 acumulado.push(acum);
705 874 ultimo = ultimo + temp;
706   - soma += temp;
707   - if(temp > maior)
708   - {maior = temp;}
709   - if(temp < menor)
710   - {menor = temp;}
711   - temp = inputs[i].value * 1;
712   - if(temp > maiorNome)
713   - {maiorNome = temp;}
714   - if(temp < menorNome)
715   - {menorNome = temp;}
716   - //par.push({"value":inputs[i+1].value * 1,"label":inputs[i].value+" "});
717   - par.push([inputs[i].value+" ",inputs[i+1].value * 1]);
718   - temp = inputs[i+1].value * 1;
719   - if($i("i3GEOgraficointerativo1Acumula").checked)
720   - {temp = acum;}
721   - if($i("i3GEOgraficointerativo1Relativa").checked)
722   - {temp = (temp * 100) / total;}
723   - //parcor.push({"colour":inputs[i+2].value,"value":temp,"label":inputs[i].value+" "});
724   - parcor.push([inputs[i].value+" ",temp,inputs[i+2].value]);
725   - }
726   - if($i("i3GEOgraficointerativo1Acumula").checked){
727   - valores = acumulado;
728   - maior = soma;
  875 + if (temp > maior) {
  876 + maior = temp;
  877 + }
  878 + if (temp < menor) {
  879 + menor = temp;
  880 + }
  881 + temp = inputs[i + 1].value * 1;
  882 + if ($i("i3GEOgraficointerativo1Acumula").checked) {
  883 + temp = acum;
  884 + }
  885 + if ($i("i3GEOgraficointerativo1Relativa").checked) {
  886 + temp = (temp * 100) / total;
  887 + }
  888 + par.push([ inputs[i].value + " ", temp ]);
729 889 }
730   - if(legendaX == legendaY){
731   - menor = 0;
732   - legendaX += " ("+$trad(45,i3GEOF.graficointerativo1.dicionario)+")";
733   - legendaY += " ("+$trad(46,i3GEOF.graficointerativo1.dicionario)+")";
  890 + if ($i("i3GEOgraficointerativo1Acumula").checked) {
  891 + maior = 0;
734 892 }
735   - if($i("i3GEOgraficointerativo1Relativa").checked){
736   - n = valores.length;
737   - for(i=0;i<n;i++){
738   - valores[i] = (valores[i] * 100) / soma;
  893 + }
  894 + else{
  895 + total = 0;
  896 + for (i = 0; i < ninputs; i = (i + 1 + ncolunas)){
  897 + temp = [];
  898 + for(j=0;j<ncolunas;j++){
  899 + temp.push(inputs[i + j].value);
739 900 }
740   - maior = 100;
741   - menor = 0;
  901 + //cores.push(inputs[j].value);
  902 + par.push(temp);
742 903 }
743   - dados = {
744   - "resultset": par,
745   - "metadata": [
746   - {"colIndex":0,"colType":"String","colName":"X"},
747   - {"colIndex":1,"colType":"Numeric","colName":"Y"}
748   - ]
749   - };
750   - switch(i3GEOF.graficointerativo1.tipo){
751   - case "bar_1":
752   - legendaX = "";
753   - i3GEOF.graficointerativo1.barras(dados,maior,cores,legendaY,legendaX,xInclinado,"vertical");
754   - break;
755   - case "bar_2":
756   - legendaX = "";
757   - i3GEOF.graficointerativo1.barras(dados,maior,cores,legendaY,legendaX,xInclinado,"horizontal");
758   - break;
759   - case "linha_1":
760   - legendaX = "";
761   - i3GEOF.graficointerativo1.linhas(dados,maior,cores,legendaY,legendaX,xInclinado);
762   - break;
763   - case "pizza_1":
764   - legendaX = "";
765   - i3GEOF.graficointerativo1.pizzas(dados,maior,cores,legendaY,legendaX);
766   - break;
767   - case "ponto_1":
768   - i3GEOF.graficointerativo1.pontos(dados,maior,cores,legendaY,legendaX);
769   - break;
770   - case "area_1":
771   - legendaX = "";
772   - i3GEOF.graficointerativo1.areas(dados,maior,cores,legendaY,legendaX,xInclinado);
773   - break;
774   - case "arvore_1":
775   - i3GEOF.graficointerativo1.arvores(dados,maior,cores,legendaY,legendaX);
776   - break;
777   - default:
778   - alert($trad(4,i3GEOF.graficointerativo1.dicionario));
779   - }
780   - },
781   - /*
782   - Function: excluilinha
783   -
784   - Exclui uma linha da tabela de dados
785   - */
786   - excluilinha: function(celula){
787   - var p = celula.parentNode.parentNode;
788   - do{
789   - p.removeChild(p.childNodes[0]);
790   - } while (p.childNodes.length > 0);
791   - p.parentNode.removeChild(p);
792   - },
793   - /*
794   - Function: corj
795   -
796   - Abre a janela para o usu&aacute;rio selecionar uma cor interativamente
797   - */
798   - corj: function(obj)
799   - {i3GEO.util.abreCor("",obj,"hex");},
800   - /*
801   - Function: ordenaColuna
802   -
803   - Ordena uma coluna da tabela
804   - */
805   - ordenaColuna: function(coluna,cid){
806   - try{
807   - var tabela = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("table")[0],
808   - trs = tabela.getElementsByTagName("tr"),
809   - ntrs = trs.length,
810   - psort = [],
811   - t = 0,
812   - npsortfim,
813   - ins = "",
814   - p = 0,
815   - e,
816   - temp,
817   - chaves = [],
818   - numero = false;
  904 + cores = "";
  905 + }
  906 + if (legendaX == legendaY) {
  907 + menor = 0;
  908 + legendaX += " (" + $trad(45, i3GEOF.graficointerativo1.dicionario)
  909 + + ")";
  910 + legendaY += " (" + $trad(46, i3GEOF.graficointerativo1.dicionario)
  911 + + ")";
  912 + }
819 913  
820   - function sortNumber(a,b)
821   - {return a - b;}
822   - for(t=1;t<ntrs;t++){
823   - temp = trs[t].childNodes[cid];
824   - if(temp){
825   - psort.push(temp.childNodes[0].value);
826   - chaves[temp.childNodes[0].value] = t;
827   - if(temp.childNodes[0].value *1)
828   - {numero = true;}
829   - }
830   - }
831   - //recosntroi a tabela
832   - if(numero)
833   - {psort = psort.sort(sortNumber);}
834   - else
835   - {psort = psort.sort();}
836   - ins = "<tr>" + trs[0].innerHTML + "</tr>";
837   - npsortfim = psort.length;
838   - for (p=0;p<psort;p++)
839   - {
840   - e = chaves[psort[p]];
841   - if (trs[e] !== undefined)
842   - {ins += "<tr>" + trs[e].innerHTML + "</tr>";}
  914 + for(j=0;j<ncolunas;j++){
  915 + metadados.push({
  916 + "colIndex" : j,
  917 + "colType" : tipoColuna,
  918 + "colName" : colunas[j]
  919 + });
  920 + tipoColuna = "Numeric";
  921 + }
  922 + dados = {
  923 + "resultset" : par,
  924 + "metadata" : metadados
  925 + };
  926 + switch (i3GEOF.graficointerativo1.tipo) {
  927 + case "bar_1":
  928 + legendaX = "";
  929 + i3GEOF.graficointerativo1.barras(dados, maior, cores, legendaY,
  930 + legendaX, xInclinado, "vertical");
  931 + break;
  932 + case "bar_2":
  933 + legendaX = "";
  934 + i3GEOF.graficointerativo1.barras(dados, maior, cores, legendaY,
  935 + legendaX, xInclinado, "horizontal");
  936 + break;
  937 + case "linha_1":
  938 + legendaX = "";
  939 + i3GEOF.graficointerativo1.linhas(dados, maior, cores, legendaY,
  940 + legendaX, xInclinado);
  941 + break;
  942 + case "pizza_1":
  943 + legendaX = "";
  944 + i3GEOF.graficointerativo1.pizzas(dados, maior, cores, legendaY,
  945 + legendaX);
  946 + break;
  947 + case "ponto_1":
  948 + i3GEOF.graficointerativo1.pontos(dados, maior, cores, legendaY,
  949 + legendaX);
  950 + break;
  951 + case "area_1":
  952 + legendaX = "";
  953 + i3GEOF.graficointerativo1.areas(dados, maior, cores, legendaY,
  954 + legendaX, xInclinado);
  955 + break;
  956 + case "arvore_1":
  957 + i3GEOF.graficointerativo1.arvores(dados, maior, cores, legendaY,
  958 + legendaX);
  959 + break;
  960 + default:
  961 + alert($trad(4, i3GEOF.graficointerativo1.dicionario));
  962 + }
  963 + },
  964 + /*
  965 + * Function: excluilinha
  966 + *
  967 + * Exclui uma linha da tabela de dados
  968 + */
  969 + excluilinha : function(celula) {
  970 + var p = celula.parentNode.parentNode;
  971 + do {
  972 + p.removeChild(p.childNodes[0]);
  973 + } while (p.childNodes.length > 0);
  974 + p.parentNode.removeChild(p);
  975 + },
  976 + /*
  977 + * Function: corj
  978 + *
  979 + * Abre a janela para o usu&aacute;rio selecionar uma cor interativamente
  980 + */
  981 + corj : function(obj) {
  982 + i3GEO.util.abreCor("", obj, "hex");
  983 + },
  984 + /*
  985 + * Function: ordenaColuna
  986 + *
  987 + * Ordena uma coluna da tabela
  988 + */
  989 + ordenaColuna : function(coluna, cid) {
  990 + var tabela = $i("i3GEOgraficointerativo1Dados").getElementsByTagName(
  991 + "table")[0], trs, ntrs = 0, psort = [], t = 0, ins = "", p = 0, e, temp, chaves = [], numero = false;
  992 +
  993 + trs = tabela.getElementsByTagName("tr");
  994 + ntrs = trs.length;
  995 +
  996 + function sortNumber(a, b) {
  997 + return a - b;
  998 + }
  999 + for (t = 1; t < ntrs; t++) {
  1000 + temp = trs[t].childNodes[cid];
  1001 + if (temp) {
  1002 + psort.push(temp.childNodes[0].value);
  1003 + chaves[temp.childNodes[0].value] = t;
  1004 + if (temp.childNodes[0].value * 1) {
  1005 + numero = true;
843 1006 }
844   - tabela.innerHTML = ins;
845 1007 }
846   - catch(e){}
847   - },
848   - /*
849   - Function: ativaNavegacao
850   -
851   - Ativa ou desativa a atualiza&ccedil;&atilde;o autom&aacute;tica ao navegar no mapa
852   - */
853   - ativaNavegacao: function(obj){
854   - if(!i3GEO.Interface){
855   - return;
  1008 + }
  1009 + // recosntroi a tabela
  1010 + if (numero === true) {
  1011 + psort = psort.sort(sortNumber);
  1012 + } else {
  1013 + psort = psort.sort();
  1014 + }
  1015 + ins = "<tr>" + trs[0].innerHTML + "</tr>";
  1016 + for (p = 0; p < psort; p++) {
  1017 + e = chaves[psort[p]];
  1018 + if (trs[e] !== undefined) {
  1019 + ins += "<tr>" + trs[e].innerHTML + "</tr>";
856 1020 }
857   - if(obj === true){
858   - if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){
859   - i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo1.obterDados()");
860   - }
861   - if(i3GEO.Interface.ATUAL === "googlemaps"){
862   - graficointerativo1Dragend = GEvent.addListener(i3GeoMap, "dragend", function() {i3GEOF.graficointerativo1.obterDados();});
863   - graficointerativo1Zoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {i3GEOF.graficointerativo1.obterDados();});
864   - }
865   - if(i3GEO.Interface.ATUAL === "googleearth"){
866   - graficointerativo1Dragend = google.earth.addEventListener(i3GeoMap.getView(), "viewchangeend", function() {i3GEOF.graficointerativo1.obterDados();});
867   - }
  1021 + }
  1022 + tabela.innerHTML = ins;
  1023 + },
  1024 + /*
  1025 + * Function: ativaNavegacao
  1026 + *
  1027 + * Ativa ou desativa a atualiza&ccedil;&atilde;o autom&aacute;tica ao
  1028 + * navegar no mapa
  1029 + */
  1030 + ativaNavegacao : function(obj) {
  1031 + if (!i3GEO.Interface) {
  1032 + return;
  1033 + }
  1034 + if (obj === true) {
  1035 + if (i3GEO.Interface.ATUAL !== "googlemaps"
  1036 + && i3GEO.Interface.ATUAL !== "googleearth") {
  1037 + i3GEO.eventos.NAVEGAMAPA
  1038 + .push("i3GEOF.graficointerativo1.obterDados()");
868 1039 }
869   - else{
870   - if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){
871   - i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.obterDados()");
872   - }
873   - if(i3GEO.Interface.ATUAL === "googlemaps"){
874   - GEvent.removeListener(graficointerativo1Dragend);
875   - GEvent.removeListener(graficointerativo1Zoomend);
876   - }
877   - if(i3GEO.Interface.ATUAL === "googleearth"){
878   - google.earth.removeEventListener(graficointerativo1Dragend);
879   - }
  1040 + if (i3GEO.Interface.ATUAL === "googlemaps") {
  1041 + graficointerativo1Dragend = GEvent.addListener(i3GeoMap,
  1042 + "dragend", function() {
  1043 + i3GEOF.graficointerativo1.obterDados();
  1044 + });
  1045 + graficointerativo1Zoomend = GEvent.addListener(i3GeoMap,
  1046 + "zoomend", function() {
  1047 + i3GEOF.graficointerativo1.obterDados();
  1048 + });
880 1049 }
881   - },
882   - configDefault: function(dados,maior,cores,legendaY,legendaX){
883   - var config = {
884   - canvas : "i3GEOgraficointerativo1guia4objCanvas",
885   - width : dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
886   - height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
887   - orthoAxisTitle: legendaY,
888   - orthoAxisFixedMax: maior,
889   - valuesFont : 'normal 9px sans-serif ',
890   - baseAxisTitle: legendaX,
891   - baseAxisTitleAlign: 'left',
892   - tooltipEnabled : true,
893   - tooltipArrowVisible: true,
894   - tooltipFade : false,
895   - tooltipFollowMouse : false,
896   - tooltipFormat : function(scene) {
897   - var cat = this.scene.datum.atoms['category'].value,
898   - val = this.scene.datum.atoms['value'].value;
899   - return "<span style=color:yellow >"+cat+"</span><br>" + format( "#.###,", val);
900   - },
901   - baseAxisTitleFont : '9px sans-serif',
902   - yAxisTickFormatter: function(valor){
903   - valor = valor+"";
904   - valor = format( "#.###,", valor);
905   - return valor;
906   - },
907   - valueFormat: function(valor){
908   - valor = valor+"";
909   - valor = format( "#.###,", valor);
910   - return valor;
911   - },
912   - valuesAnchor : 'top',
913   - valuesVisible: false,
914   - orthoAxisOriginIsZero:false,
915   - titleAlign : 'center',
916   - orientation: 'vertical',
917   - baseAxisTicks: true,
918   - stacked : false,
919   - animate : true,
920   - hoverable: false,
921   - axisGrid: true,
922   - contentMargins :5,
923   - axisOffset: 0.02,
924   - panelSizeRatio : 0.8,
925   - orthoAxisLabelSpacingMin : 2 ,
926   - selectable : false,
927   - extensionPoints: {
928   - continuousAxisTicks_strokeStyle: 'gray',
929   - axisGrid_strokeStyle: 'lightgray',
930   - xAxisLabel_textStyle: 'black',
931   - label_textBaseline: "bottom",
932   - xAxisLabel_font: 'normal 10px sans-serif'
933   - }
934   - };
935   - return config;
936   - },
937   - barras: function(dados,maior,cores,legendaY,legendaX,xInclinado,tipo){
938   - config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
939   - config.extensionPoints.bar_fillStyle = function(d) {
940   - return cores[this.index];
  1050 + if (i3GEO.Interface.ATUAL === "googleearth") {
  1051 + graficointerativo1Dragend = google.earth.addEventListener(
  1052 + i3GeoMap.getView(), "viewchangeend", function() {
  1053 + i3GEOF.graficointerativo1.obterDados();
  1054 + });
941 1055 }
942   - if(tipo === "horizontal"){
943   - config.orientation = 'horizontal';
  1056 + } else {
  1057 + if (i3GEO.Interface.ATUAL !== "googlemaps"
  1058 + && i3GEO.Interface.ATUAL !== "googleearth") {
  1059 + i3GEO.eventos.NAVEGAMAPA
  1060 + .remove("i3GEOF.graficointerativo1.obterDados()");
944 1061 }
945   - if(xInclinado == true){
946   - config.extensionPoints.xAxisLabel_textAngle = -Math.PI/3;
947   - config.extensionPoints.xAxisLabel_textBaseline = 'top';
948   - config.extensionPoints.xAxisLabel_textAlign = 'right';
  1062 + if (i3GEO.Interface.ATUAL === "googlemaps") {
  1063 + GEvent.removeListener(graficointerativo1Dragend);
  1064 + GEvent.removeListener(graficointerativo1Zoomend);
949 1065 }
950   - new pvc.BarChart(
951   - config
952   - ).setData(dados, {
953   - crosstabMode : false
954   - }).render();
955   - i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
956   - },
957   - linhas: function(dados,maior,cores,legendaY,legendaX,xInclinado,tipo){
958   - config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
959   - if(xInclinado == true){
960   - config.extensionPoints.xAxisLabel_textAngle = -Math.PI/3;
961   - config.extensionPoints.xAxisLabel_textBaseline = 'top';
962   - config.extensionPoints.xAxisLabel_textAlign = 'right';
  1066 + if (i3GEO.Interface.ATUAL === "googleearth") {
  1067 + google.earth.removeEventListener(graficointerativo1Dragend);
963 1068 }
964   - config.dotsVisible = true;
965   - new pvc.LineChart(
966   - config
967   - ).setData(dados, {
968   - crosstabMode : false
969   - }).render();
970   - i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
971   - },
972   - areas: function(dados,maior,cores,legendaY,legendaX,xInclinado,tipo){
973   - config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
974   - if(xInclinado == true){
975   - config.extensionPoints.xAxisLabel_textAngle = -Math.PI/3;
976   - config.extensionPoints.xAxisLabel_textBaseline = 'top';
977   - config.extensionPoints.xAxisLabel_textAlign = 'right';
  1069 + }
  1070 + },
  1071 + configDefault : function(dados, maior, cores, legendaY, legendaX) {
  1072 + var config = {
  1073 + canvas : "i3GEOgraficointerativo1guia4objCanvas",
  1074 + width : dados.resultset.length
  1075 + * $i("i3GEOgraficointerativo1FatorTamanho").value,
  1076 + height : parseInt(
  1077 + $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
  1078 + orthoAxisTitle : legendaY,
  1079 + valuesFont : 'normal 9px sans-serif ',
  1080 + baseAxisTitle : legendaX,
  1081 + baseAxisTitleAlign : 'left',
  1082 + tooltipEnabled : true,
  1083 + tooltipArrowVisible : true,
  1084 + tooltipFade : false,
  1085 + tooltipFollowMouse : false,
  1086 + tooltipFormat : function(scene) {
  1087 + var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;
  1088 + return "<span style=color:yellow >" + cat + "</span><br>"
  1089 + + format("#.###,", val);
  1090 + },
  1091 + baseAxisTitleFont : '9px sans-serif',
  1092 + yAxisTickFormatter : function(valor) {
  1093 + valor = valor + "";
  1094 + valor = format("#.###,", valor);
  1095 + return valor;
  1096 + },
  1097 + valueFormat : function(valor) {
  1098 + valor = valor + "";
  1099 + valor = format("#.###,", valor);
  1100 + return valor;
  1101 + },
  1102 + valuesAnchor : 'top',
  1103 + valuesVisible : false,
  1104 + orthoAxisOriginIsZero : false,
  1105 + titleAlign : 'center',
  1106 + orientation : 'vertical',
  1107 + baseAxisTicks : true,
  1108 + stacked : false,
  1109 + animate : true,
  1110 + hoverable : false,
  1111 + axisGrid : true,
  1112 + contentMargins : 5,
  1113 + axisOffset : 0.02,
  1114 + panelSizeRatio : 0.8,
  1115 + orthoAxisLabelSpacingMin : 2,
  1116 + selectable : false,
  1117 + extensionPoints : {
  1118 + continuousAxisTicks_strokeStyle : 'gray',
  1119 + axisGrid_strokeStyle : 'lightgray',
  1120 + xAxisLabel_textStyle : 'black',
  1121 + label_textBaseline : "bottom",
  1122 + xAxisLabel_font : 'normal 10px sans-serif'
978 1123 }
979   - config.dotsVisible = true;
980   - config.areasVisible = true;
981   - new pvc.LineChart(
982   - config
983   - ).setData(dados, {
984   - crosstabMode : false
985   - }).render();
986   - i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
987   - },
988   - arvores: function(dados,maior,cores,legendaY,legendaX,tipo){
989   - //config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
990   - //config.rootCategoryLabel = legendaX;
991   - config = {
992   - canvas: "i3GEOgraficointerativo1guia4objCanvas",
993   - width: dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
994   - height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
995   - title: legendaY,
996   - titleFont: 'italic 14px sans-serif',
997   - selectable: true,
998   - hoverable: true,
999   - legend: false,
1000   - tooltipEnabled : true,
1001   - legendPosition: 'right',
1002   - rootCategoryLabel: legendaX,
1003   - colors: cores,
1004   - tooltipFormat : function(scene) {
1005   - var cat = this.scene.datum.atoms['category'].value,
1006   - val = this.scene.datum.atoms.size.value;
1007   - return "<span style=color:yellow >"+cat+"</span><br>" + format( "#.###,", val);
1008   - }
1009   - };
1010   - new pvc.TreemapChart(
1011   - config
1012   - ).setData(dados, {
1013   - crosstabMode : false
1014   - }).render();
1015   - i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
1016   - },
1017   - pizzas: function(dados,maior,cores,legendaY,legendaX,tipo){
1018   - config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
1019   - var config = {
1020   - canvas : "i3GEOgraficointerativo1guia4objCanvas",
1021   - width : dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
1022   - height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
1023   - animate: true,
1024   - selectable: true,
1025   - hoverable: true,
1026   - valuesVisible: true,
1027   - valuesLabelStyle: 'inside',
1028   - valuesMask: "{category}",
1029   - colors: cores,
1030   - tooltipFormat : function(scene) {
1031   - var cat = this.scene.datum.atoms['category'].value,
1032   - val = this.scene.datum.atoms['value'].value;
1033   - return "<span style=color:yellow >"+cat+"</span><br>" + format( "#.###,", val);
1034   - },
1035   - extensionPoints: {
1036   - slice_strokeStyle: 'white'
1037   - }
1038   - };
1039   - new pvc.PieChart(
1040   - config
1041   - ).setData(dados, {
1042   - crosstabMode : false
1043   - }).render();
1044   - i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
1045   - },
1046   - pontos: function(dados,maior,cores,legendaY,legendaX,tipo){
1047   - config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
1048   - var config = {
1049   - canvas : "i3GEOgraficointerativo1guia4objCanvas",
1050   - width : dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
1051   - height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
1052   - animate: true,
1053   - selectable: true,
1054   - hoverable: true,
1055   - valuesVisible: false,
1056   - colors: cores,
1057   - orthoAxisTitle: legendaY,
1058   - valuesFont : 'normal 9px sans-serif ',
1059   - baseAxisTitle: legendaX,
1060   - yAxisTickFormatter: function(valor){
1061   - valor = valor+"";
1062   - valor = format( "#.###,", valor);
1063   - return valor;
1064   - },
1065   - valueFormat: function(valor){
1066   - valor = valor+"";
1067   - valor = format( "#.###,", valor);
1068   - return valor;
1069   - },
1070   - tooltipFormat : function(scene) {
1071   - var cat = this.scene.datum.atoms['category'].value,
1072   - val = this.scene.datum.atoms['value'].value;
1073   - return "<span style=color:yellow >X: "+cat+"</span><br>Y: " + format( "#.###,", val);
1074   - }
  1124 + };
  1125 + if(maior > 0){
  1126 + config.orthoAxisFixedMax = maior;
  1127 + }
  1128 + return config;
  1129 + },
  1130 + barras : function(dados, maior, cores, legendaY, legendaX, xInclinado, tipo) {
  1131 + var ct = true,
  1132 + sr = false,
  1133 + config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
  1134 + legendaY, legendaX);
  1135 + if(cores != ""){
  1136 + config.extensionPoints.bar_fillStyle = function(d) {
  1137 + return cores[this.index];
1075 1138 };
1076   - new pvc.DotChart(
1077   - config
1078   - ).setData(dados, {
1079   - crosstabMode : false
1080   - }).render();
1081   - i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
1082 1139 }
1083   -};
1084 1140 \ No newline at end of file
  1141 + if (tipo === "horizontal") {
  1142 + config.orientation = 'horizontal';
  1143 + }
  1144 + if (xInclinado == true) {
  1145 + config.extensionPoints.xAxisLabel_textAngle = -Math.PI / 3;
  1146 + config.extensionPoints.xAxisLabel_textBaseline = 'top';
  1147 + config.extensionPoints.xAxisLabel_textAlign = 'right';
  1148 + }
  1149 + if(dados.resultset[0].length > 2){
  1150 + config.stacked = $i("i3GEOFgraficointerativo1ativaStacked").checked;
  1151 + config.legend = true;
  1152 + ct = true;
  1153 + sr = $i("i3GEOFgraficointerativo1ativaRowsInColumns").checked;
  1154 + }
  1155 + new pvc.BarChart(config).setData(dados, {
  1156 + crosstabMode : ct,
  1157 + seriesInRows: sr
  1158 + }).render();
  1159 + i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
  1160 + },
  1161 + linhas : function(dados, maior, cores, legendaY, legendaX, xInclinado, tipo) {
  1162 + var ct = false,
  1163 + sr = false,
  1164 + config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
  1165 + legendaY, legendaX);
  1166 + if (xInclinado == true) {
  1167 + config.extensionPoints.xAxisLabel_textAngle = -Math.PI / 3;
  1168 + config.extensionPoints.xAxisLabel_textBaseline = 'top';
  1169 + config.extensionPoints.xAxisLabel_textAlign = 'right';
  1170 + }
  1171 + config.dotsVisible = true;
  1172 +
  1173 + if(dados.resultset[0].length > 2){
  1174 + config.stacked = $i("i3GEOFgraficointerativo1ativaStacked").checked;
  1175 + config.legend = true;
  1176 + ct = true;
  1177 + sr = $i("i3GEOFgraficointerativo1ativaRowsInColumns").checked;
  1178 + }
  1179 + new pvc.LineChart(config).setData(dados, {
  1180 + crosstabMode : ct,
  1181 + seriesInRows: sr
  1182 + }).render();
  1183 + i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
  1184 + },
  1185 + areas : function(dados, maior, cores, legendaY, legendaX, xInclinado, tipo) {
  1186 + var ct = false,
  1187 + sr = false,
  1188 + config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
  1189 + legendaY, legendaX);
  1190 + if (xInclinado == true) {
  1191 + config.extensionPoints.xAxisLabel_textAngle = -Math.PI / 3;
  1192 + config.extensionPoints.xAxisLabel_textBaseline = 'top';
  1193 + config.extensionPoints.xAxisLabel_textAlign = 'right';
  1194 + }
  1195 + config.dotsVisible = true;
  1196 + config.areasVisible = true;
  1197 +
  1198 + if(dados.resultset[0].length > 2){
  1199 + config.stacked = $i("i3GEOFgraficointerativo1ativaStacked").checked;
  1200 + config.legend = true;
  1201 + ct = true;
  1202 + sr = $i("i3GEOFgraficointerativo1ativaRowsInColumns").checked;
  1203 + }
  1204 + new pvc.LineChart(config).setData(dados, {
  1205 + crosstabMode : ct,
  1206 + seriesInRows: sr
  1207 + }).render();
  1208 + i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
  1209 + },
  1210 + arvores : function(dados, maior, cores, legendaY, legendaX, tipo) {
  1211 + // config =
  1212 + // i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
  1213 + // config.rootCategoryLabel = legendaX;
  1214 + config = {
  1215 + canvas : "i3GEOgraficointerativo1guia4objCanvas",
  1216 + width : dados.resultset.length
  1217 + * $i("i3GEOgraficointerativo1FatorTamanho").value,
  1218 + height : parseInt(
  1219 + $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
  1220 + title : legendaY,
  1221 + titleFont : 'italic 14px sans-serif',
  1222 + selectable : true,
  1223 + hoverable : true,
  1224 + legend : false,
  1225 + tooltipEnabled : true,
  1226 + legendPosition : 'right',
  1227 + rootCategoryLabel : legendaX,
  1228 + tooltipFormat : function(scene) {
  1229 + var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms.size.value;
  1230 + return "<span style=color:yellow >" + cat + "</span><br>"
  1231 + + format("#.###,", val);
  1232 + }
  1233 + };
  1234 + if(cores != ""){
  1235 + config.colors = cores;
  1236 + }
  1237 + new pvc.TreemapChart(config).setData(dados, {
  1238 + crosstabMode : false
  1239 + }).render();
  1240 + i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
  1241 + },
  1242 + pizzas : function(dados, maior, cores, legendaY, legendaX, tipo) {
  1243 + config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
  1244 + legendaY, legendaX);
  1245 + var config = {
  1246 + canvas : "i3GEOgraficointerativo1guia4objCanvas",
  1247 + width : dados.resultset.length
  1248 + * $i("i3GEOgraficointerativo1FatorTamanho").value,
  1249 + height : parseInt(
  1250 + $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
  1251 + animate : true,
  1252 + selectable : true,
  1253 + hoverable : true,
  1254 + valuesVisible : true,
  1255 + valuesLabelStyle : 'inside',
  1256 + valuesMask : "{category}",
  1257 + tooltipFormat : function(scene) {
  1258 + var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;
  1259 + return "<span style=color:yellow >" + cat + "</span><br>"
  1260 + + format("#.###,", val);
  1261 + },
  1262 + extensionPoints : {
  1263 + slice_strokeStyle : 'white'
  1264 + }
  1265 + };
  1266 + if(cores != ""){
  1267 + config.colors = cores;
  1268 + }
  1269 + new pvc.PieChart(config).setData(dados, {
  1270 + crosstabMode : false
  1271 + }).render();
  1272 + i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
  1273 + },
  1274 + pontos : function(dados, maior, cores, legendaY, legendaX, tipo) {
  1275 + config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
  1276 + legendaY, legendaX);
  1277 + var config = {
  1278 + canvas : "i3GEOgraficointerativo1guia4objCanvas",
  1279 + width : dados.resultset.length
  1280 + * $i("i3GEOgraficointerativo1FatorTamanho").value,
  1281 + height : parseInt(
  1282 + $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
  1283 + animate : true,
  1284 + selectable : true,
  1285 + hoverable : true,
  1286 + valuesVisible : false,
  1287 + orthoAxisTitle : legendaY,
  1288 + valuesFont : 'normal 9px sans-serif ',
  1289 + baseAxisTitle : legendaX,
  1290 + yAxisTickFormatter : function(valor) {
  1291 + valor = valor + "";
  1292 + valor = format("#.###,", valor);
  1293 + return valor;
  1294 + },
  1295 + valueFormat : function(valor) {
  1296 + valor = valor + "";
  1297 + valor = format("#.###,", valor);
  1298 + return valor;
  1299 + },
  1300 + tooltipFormat : function(scene) {
  1301 + var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;
  1302 + return "<span style=color:yellow >X: " + cat + "</span><br>Y: "
  1303 + + format("#.###,", val);
  1304 + }
  1305 + };
  1306 + if(cores != ""){
  1307 + config.colors = cores;
  1308 + }
  1309 + new pvc.DotChart(config).setData(dados, {
  1310 + crosstabMode : false
  1311 + }).render();
  1312 + i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
  1313 + }
  1314 +};
... ...
ferramentas/metaestat/analise.php
... ... @@ -690,14 +690,14 @@ function juntaMedidasVariaveis($map_file,$layerNames,$nome){
690 690 $cwhere[] = "tabela0.".$colunasIdentificador[0]."::text = "."tabela".$i.".".$colunasIdentificador[$i]."::text";
691 691 }
692 692 $colunasDados = array();
693   - $itens = array($gid);
694   - $itensdesc = array("gid");
  693 + $itens = array($gid,"regiao");
  694 + $itensdesc = array("gid","Regiao");
695 695 for($i=0;$i<$n;$i++){
696   - $colunasDados[] = "tabela".$i.".".$colunasValor[$i]." as valorTema".$i;
697   - $itens[] = "valorTema".$i;
  696 + $colunasDados[] = "tabela".$i.".".$colunasValor[$i]." as valortema".$i;
  697 + $itens[] = "valortema".$i;
698 698 $itensdesc[] = $nomesLayers[$i];
699 699 }
700   - $sqlfinal = "SELECT tabela0.".$gid.",tabela0.".$regiao["colunageo"]." as the_geom,".implode(",",$colunasDados)." from ".implode(",",$sqls)." WHERE ";
  700 + $sqlfinal = "SELECT tabela0.".$gid.",tabela0.".$regiao["colunanomeregiao"]." as regiao,tabela0.".$regiao["colunageo"]." as the_geom,".implode(",",$colunasDados)." from ".implode(",",$sqls)." WHERE ";
701 701 $sqlfinal .= implode($cwhere," AND ");
702 702 $sqlfinal = str_replace("/*FA*/","",$sqlfinal);
703 703 $sqlfinal = str_replace("/*FAT*/","",$sqlfinal);
... ... @@ -713,7 +713,6 @@ function juntaMedidasVariaveis($map_file,$layerNames,$nome){
713 713 $nlayer->setmetadata("nomeoriginal","");
714 714 $nlayer->setmetadata("ITENS",implode(",",$itens));
715 715 $nlayer->setmetadata("ITENSDESC",implode(",",$itensdesc));
716   -
717 716 $nclass = $nlayer->numclasses;
718 717 for($i=1;$i<$nclass;$i++){
719 718 $nlayer->getclass($i)->set("status",MS_DELETE);
... ...