From 6b7c17511133327a2e58742e7683bcb2b708b7ba Mon Sep 17 00:00:00 2001
From: Edmar Moretti
Date: Tue, 10 Sep 2013 18:07:10 +0000
Subject: [PATCH] $1
---
admin/admin.db | Bin 208896 -> 0 bytes
admin/php/classe_metaestat.php | 8 ++++++--
classesphp/classe_atributos.php | 1 +
classesphp/graficos.php | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------
css/geral.css | 5 +++++
css/i3geo5.css | 5 +++++
css/i3geo5.css.php | 5 +++++
ferramentas/graficointerativo1/dicionario.js | 8 ++++----
ferramentas/graficointerativo1/exec.php | 4 ++++
ferramentas/graficointerativo1/index.js | 2212 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ferramentas/metaestat/analise.php | 11 +++++------
11 files changed, 1337 insertions(+), 1082 deletions(-)
diff --git a/admin/admin.db b/admin/admin.db
index 384ed59..ba4ea63 100644
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/admin/php/classe_metaestat.php b/admin/php/classe_metaestat.php
index d563f3a..fbd0527 100755
--- a/admin/php/classe_metaestat.php
+++ b/admin/php/classe_metaestat.php
@@ -372,6 +372,7 @@ class Metaestat{
//
//prepara os alias das colunas
//
+ $colunas = array_unique($colunas);
$alias = $colunas;
$n = count($colunas);
for($i=0;$i<$n;$i++){
@@ -541,7 +542,7 @@ class Metaestat{
//echo $sqlf;exit;
if(!empty($filtro)){
$sqlf = str_replace("__filtro__"," AND ".$filtro." /*FA*//*FA*/ /*FAT*//*FAT*/",$sqlf);
- $sql["titulo"] .= ", ".$filtro;
+ $sql["titulo"] .= " - ".$filtro;
}
else{
$sqlf = str_replace("__filtro__"," /*FA*//*FA*/ /*FAT*//*FAT*/",$sqlf);
@@ -560,6 +561,9 @@ class Metaestat{
else{
$titulolayer = mb_convert_encoding($sql["titulo"],"ISO-8859-1",mb_detect_encoding($sql["titulo"]));
}
+ //necessario para evitar problemas com ITENSDESC
+ $titulolayer = str_replace(","," ",$titulolayer);
+ $titulolayer = str_replace("=",": ",$titulolayer);
//pega os parametros caso seja um mapfile para WMS-time
if($suportaWMST == true){
$sqlMinMax = "select min(dimtempo) as min,max(dimtempo) as max from(".$sql["sql"].") as x";
@@ -920,7 +924,7 @@ class Metaestat{
$sqlf .= " limit ".$limite;
}
$metaVariavel = $this->listaMedidaVariavel("",$id_medida_variavel);
-
+
if(!empty($metaVariavel["codigo_estat_conexao"])){
$c = $this->listaConexao($metaVariavel["codigo_estat_conexao"],true);
$dbhold = $this->dbh;
diff --git a/classesphp/classe_atributos.php b/classesphp/classe_atributos.php
index c469008..3121176 100644
--- a/classesphp/classe_atributos.php
+++ b/classesphp/classe_atributos.php
@@ -2290,6 +2290,7 @@ class Atributos
$resultado[] = $shape->values[$item];
}
else{
+ //var_dump($itens);exit;
foreach ($itens as $it){
$val = $shape->values[$it];
if($convC == true){
diff --git a/classesphp/graficos.php b/classesphp/graficos.php
index cc39243..310db0b 100644
--- a/classesphp/graficos.php
+++ b/classesphp/graficos.php
@@ -377,11 +377,10 @@ function iniciaParGrafico($gw,$gh,$res,$dir_tmp,$gfile_name,$margem,$margemexter
function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,$percentual,$ext="",$incluicores=true,$ordenax="nao")
{
global $interface;
- //pega os valores
- //error_reporting(0);
+ //prepara o mapfile
+ //
$map = ms_newMapObj($map_file);
- if($interface == "googlemaps")
- {
+ if($interface == "googlemaps"){
$projMapa = $map->getProjection();
$map->setProjection("init=epsg:4618,a=6378137,b=6378137");
}
@@ -391,57 +390,70 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t
$extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3])));
}
$layer = $map->getLayerByName($tema);
+ //verifica se tem selecao
$selecionados = carregaquery2($map_file,$layer,$map);
if ($exclui == ""){$exclui = "nulo";}
- $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados);
- $dados = agrupaValores($valores,0,1,$tipo);
- foreach($valores as $valor){
- $cores[$valor[0]] = $valor["cores"];
- }
- //calcula os parametros para o grafico
- $nval = count($dados);
- $max = max($dados);
- $soma = array_sum($dados);
- $tempm = array_keys($dados);
- $tempval = array();
- $nnval[] = "n;x";
- if ($tipo != "xy")
- {
- for ($i=0;$i < $nval; ++$i)
- {
- if ($dados[$tempm[$i]] > 0)
- {
- $pp = ($dados[$tempm[$i]] * 100) / $soma;
- if ($percentual == "TRUE")
- {
-
- $temp = "'".$tempm[$i]." (".round($pp,0)."%)';".$dados[$tempm[$i]];
- if($incluicores == true)
- {$temp = $temp.";".$cores[$tempm[$i]];}
+ //pega os valores
+ //$itemvalores pode ser um array de intens
+ $nnval = array();
+ if(!is_array($itemvalores)){
+ $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados);
+ //agrupa se for o caso
+ $dados = agrupaValores($valores,0,1,$tipo);
+ foreach($valores as $valor){
+ $cores[$valor[0]] = $valor["cores"];
+ }
+ //calcula os parametros para o grafico
+ $nval = count($dados);
+ $max = max($dados);
+ $soma = array_sum($dados);
+ $tempm = array_keys($dados);
+ $tempval = array();
+ $nnval[] = "n;x";
+ if ($tipo != "xy"){
+ for ($i=0;$i < $nval; ++$i){
+ if ($dados[$tempm[$i]] > 0){
+ $pp = ($dados[$tempm[$i]] * 100) / $soma;
+ if ($percentual == "TRUE"){
+ $temp = "'".$tempm[$i]." (".round($pp,0)."%)';".$dados[$tempm[$i]];
+ if($incluicores == true){
+ $temp = $temp.";".$cores[$tempm[$i]];
+ }
+ }
+ else{
+ $temp = "'".$tempm[$i]."';".$dados[$tempm[$i]];
+ if($incluicores == true){
+ $temp = $temp.";".$cores[$tempm[$i]];
+ }
+ }
+ $tempval[] = $temp;
}
- else
- {
- $temp = "'".$tempm[$i]."';".$dados[$tempm[$i]];
- if($incluicores == true)
- {$temp = $temp.";".$cores[$tempm[$i]];}
+ }
+ }
+ else{
+ foreach ($valores as $v){
+ $temp = $v[0].";".$v[1];
+ if($incluicores == true){
+ $temp = $temp.";".$cores[$v[0]];
}
$tempval[] = $temp;
}
}
- }
- else
- {
- foreach ($valores as $v)
- {
- $temp = $v[0].";".$v[1];
- if($incluicores == true)
- {$temp = $temp.";".$cores[$v[0]];}
- $tempval[] = $temp;
+ if($ordenax == "sim"){
+ sort($tempval);
}
+ $nnval = array_merge($nnval,$tempval);
+ }
+ else{
+ $colunas = array_merge(array($itemclasses),$itemvalores);
+ $valores = pegaValoresM($map,$layer,$colunas,$exclui,$selecionados);
+ $nval = count($dados);
+ $nnval[] = implode(";",$colunas);
+ foreach($valores as $valor){
+ $nnval[] = implode(";",$valor);
+ }
+ $max = "";
}
- if($ordenax == "sim")
- {sort($tempval);}
- $nnval = array_merge($nnval,$tempval);
return array("dados"=>$nnval,"ndados"=>$nval,"max"=>$max);
}
function dadosLinhaDoTempo($map_file,$tema,$ext="")
@@ -654,8 +666,7 @@ function pegaValoresM($mapa,$layer,$itens,$exclui="nulo",$selecionados="nao",$ch
$indicesel = array();
//pega os valores dos indices dos elementos selecionados para comparacao posterior
- if ($selecionados == "sim")
- {
+ if ($selecionados == "sim"){
$sopen = $layer->open();
if($sopen == MS_FAILURE){return "erro";}
$res_count = $layer->getNumresults();
@@ -668,15 +679,12 @@ function pegaValoresM($mapa,$layer,$itens,$exclui="nulo",$selecionados="nao",$ch
}
$valores = array();
$nclasses = $layer->numclasses;
- if (@$layer->queryByrect($mapa->extent) == MS_SUCCESS)
- {
+ if (@$layer->queryByrect($mapa->extent) == MS_SUCCESS){
//$layer->draw();
$sopen = $layer->open();
if($sopen == MS_FAILURE){return "erro";}
$res_count = $layer->getNumresults();
-
- for ($i=0;$i<$res_count;++$i)
- {
+ for ($i=0;$i<$res_count;++$i){
if($versao == 6){
$shape = $layer->getShape($layer->getResult($i));
$shp_index = $shape->index;
@@ -690,40 +698,42 @@ function pegaValoresM($mapa,$layer,$itens,$exclui="nulo",$selecionados="nao",$ch
{continue;}
$considera = "sim";
//verifica se no registro deve ser considerado
- if ($exclui != "nulo")
- {
+ if ($exclui != "nulo"){
foreach ($itens as $item)
{if($shape->values[$item] == $exclui){$considera = "nao";}}
}
//pega os valores
$v = array();
- if ($considera == "sim")
- {
+ if ($considera == "sim"){
+ //pega os valores dos itens do registro
foreach ($itens as $item){
if($chaves == false)
{$v[] = $shape->values[$item];}
else
{$v[$item] = $shape->values[$item];}
}
+ //pega o centroide
if($centroide == true){
$c = $shape->getCentroid();
- if (($prjTema != "") && ($prjMapa != $prjTema))
- {
+ if (($prjTema != "") && ($prjMapa != $prjTema)){
$projOutObj = ms_newprojectionobj($prjTema);
$projInObj = ms_newprojectionobj($prjMapa);
$c->project($projInObj, $projOutObj);
}
$v["centroide"] = "POINT(".$c->x." ".$c->y.")";
}
+ //pega a cor da classe onde cai o registro
if($nclasses > 0){
$classe = $layer->getclass($layer->getClassIndex($shape));
$cor = $classe->getstyle(0)->color;
$v["cores"] = $cor->red." ".$cor->green." ".$cor->blue;
}
- if (count($v) == 1)
- {$valores[] = $v[0];}
- else
- {$valores[] = $v;}
+ if (count($v) == 1){
+ $valores[] = $v[0];
+ }
+ else{
+ $valores[] = $v;
+ }
}
}
$layer->close();
@@ -754,12 +764,10 @@ Retorno:
function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
{
$valores = null;
- foreach ($lista as $linha)
- {
+ foreach ($lista as $linha){
$c = $linha[$indiceChave];
$v = $linha[$indiceValor];
- if ($tipo == "conta")
- {
+ if ($tipo == "conta"){
if(@$valores[$c])
$valores[$c] = $valores[$c] + 1;
else
@@ -767,18 +775,15 @@ function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
}
if (($tipo == "soma"))
{
- if (($v != "") && (is_numeric($v)))
- {
+ if (($v != "") && (is_numeric($v))){
if(@$valores[$c])
$valores[$c] = $valores[$c] + $v;
else
$valores[$c] = $v;
}
}
- if ($tipo == "media")
- {
- if (($v != "") && (is_numeric($v)))
- {
+ if ($tipo == "media"){
+ if (($v != "") && (is_numeric($v))){
if(@$soma[$c])
$soma[$c] = $soma[$c] + $v;
else
@@ -790,8 +795,7 @@ function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
$conta[$c] = 1;
}
}
- if ($tipo == "nenhum")
- {
+ if ($tipo == "nenhum"){
//if (($v != "") && (is_numeric($v)))
//{
$valoresn[] = $v;
@@ -799,11 +803,9 @@ function agrupaValores($lista,$indiceChave,$indiceValor,$tipo)
$valores = $valoresn;
}
}
- if ($tipo == "media")
- {
+ if ($tipo == "media"){
$chaves = array_keys($conta);
- foreach ($chaves as $c)
- {
+ foreach ($chaves as $c){
$valores[$c] = $soma[$c] / $conta[$c];
}
}
diff --git a/css/geral.css b/css/geral.css
index 93de46f..c60a07a 100644
--- a/css/geral.css
+++ b/css/geral.css
@@ -25,6 +25,11 @@ legend
{font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;}
.paragrafo
{font-size:12px;line-height:15px;margin-bottom:9px;text-align:left;}
+.paragrafo input[type=checkbox]{
+ position:relative;
+ top: 2px;
+ border: 0px solid white;
+}
.lista td
{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;}
.lista2 td
diff --git a/css/i3geo5.css b/css/i3geo5.css
index 5ca0f90..6694500 100755
--- a/css/i3geo5.css
+++ b/css/i3geo5.css
@@ -25,6 +25,11 @@ legend
{font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;}
.paragrafo
{font-size:12px;line-height:15px;margin-bottom:9px;text-align:left;}
+.paragrafo input[type=checkbox]{
+position:relative;
+top: 2px;
+border: 0px solid white;
+}
.lista td
{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;}
.lista2 td
diff --git a/css/i3geo5.css.php b/css/i3geo5.css.php
index 9c35038..48a1621 100755
--- a/css/i3geo5.css.php
+++ b/css/i3geo5.css.php
@@ -25,6 +25,11 @@ legend
{font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;}
.paragrafo
{font-size:12px;line-height:15px;margin-bottom:9px;text-align:left;}
+.paragrafo input[type=checkbox]{
+position:relative;
+top: 2px;
+border: 0px solid white;
+}
.lista td
{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;}
.lista2 td
diff --git a/ferramentas/graficointerativo1/dicionario.js b/ferramentas/graficointerativo1/dicionario.js
index 88bcd41..e5b86f0 100755
--- a/ferramentas/graficointerativo1/dicionario.js
+++ b/ferramentas/graficointerativo1/dicionario.js
@@ -85,7 +85,7 @@ i3GEOF.graficointerativo1.dicionario = {
it:""
}],
15: [{
- pt:"Item com os valores ou eixo Y",
+ pt:"Item(ns) com os valores ou eixo Y",
en:"",
es:"",
it:""
@@ -277,19 +277,19 @@ i3GEOF.graficointerativo1.dicionario = {
it:""
}],
47: [{
- pt:"",
+ pt:"Atualiza o gráfico ao navegar pelo mapa",
en:"",
es:"",
it:""
}],
48: [{
- pt:"",
+ pt:"Utiliza barras divididas entre os valores (stacked)",
en:"",
es:"",
it:""
}],
49: [{
- pt:"",
+ pt:"As linhas de dados ficam nas colunas",
en:"",
es:"",
it:""
diff --git a/ferramentas/graficointerativo1/exec.php b/ferramentas/graficointerativo1/exec.php
index 745afe1..1b7345d 100755
--- a/ferramentas/graficointerativo1/exec.php
+++ b/ferramentas/graficointerativo1/exec.php
@@ -21,6 +21,10 @@ Pega os dados necessários para a geração dos gráficos da ferramenta seleção
{$tipo = "nenhum";}
if(!isset($ordenax))
{$ordenax = "nao";}
+ $itemvalores = explode(",",$itemvalores);
+ if(count($itemvalores) == 1){
+ $itemvalores = $itemvalores[0];
+ }
$retorno = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,false,$ext,true,$ordenax);
break;
}
diff --git a/ferramentas/graficointerativo1/index.js b/ferramentas/graficointerativo1/index.js
index a32ad7a..4b42f41 100755
--- a/ferramentas/graficointerativo1/index.js
+++ b/ferramentas/graficointerativo1/index.js
@@ -1,5 +1,3 @@
-
-/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */
/*
Title: Gráfico interativo 1
@@ -39,1045 +37,1277 @@ GNU junto com este programa; se não, escreva para a
Free Software Foundation, Inc., no endereço
59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
*/
-if(typeof(i3GEOF) === 'undefined'){
+if (typeof (i3GEOF) === 'undefined') {
var i3GEOF = {};
}
/*
-Classe: i3GEOF.graficointerativo1
-
+ * Classe: i3GEOF.graficointerativo1
+ *
*/
i3GEOF.graficointerativo1 = {
- /*
- Variavel: aguarde
-
- Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela.
- */
- aguarde: "",
- /*
- Propriedade: dados
-
- Dados que serao utilizados. Pode ser passado como parametro.
-
- Default:
- {false}
- */
- dados:false,
- /*
- Propriedade: titulo
-
- Título do gráfico. Se for vazio, será obtido do nome do tema selecionado
- */
- titulo: "",
- /*
- Propriedade: tipo
-
- Tipo de gráfico escolhido pelo usuário.
- */
- tipo: "",
- /*
- Propriedade: acumula
-
- Acumula os valores ao gerar o gráfico
-
- Type:
- {boolean}
-
- Default:
- {false}
- */
- acumula: false,
- /*
- Propriedade: relativa
-
- Utiliza valores relativos ao criar o gráfico
-
- Type:
- {boolean}
-
- Default:
- {false}
- */
- relativa: false,
- /*
- Propriedade: dadospuros
-
- Não faz nenhum tipo de processamento nos dados antes de gerar o gráfico
-
- Type:
- {boolean}
-
- Default:
- {false}
- */
- dadospuros: false,
- /*
- Propriedade: navegacao
-
- Ativa ou não a navegação dinâmica do mapa
-
- Type:
- {boolean}
-
- Default:
- {false}
- */
- navegacao:false,
-
- /*
- Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário
- */
- criaJanelaFlutuante: function(dados){
- if(dados){
- i3GEOF.graficointerativo1.dados = dados;
- }
- i3GEOF.graficointerativo1.iniciaDicionario();
- },
- /*
- Function: iniciaDicionario
-
- Carrega o dicionário e chama a função que inicia a ferramenta
-
- O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script
- */
- iniciaDicionario: function(dados){
- if(dados){
- i3GEOF.graficointerativo1.dados = dados;
- }
- if(typeof(i3GEOF.graficointerativo1.dicionario) === 'undefined'){
- i3GEO.util.scriptTag(
- i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dependencias.php",
- "i3GEOF.graficointerativo1.iniciaJanelaFlutuante()",
- "i3GEOF.graficointerativo1.dicionario_script"
- );
- }
- else{
- i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);
+ /*
+ * Variavel: aguarde
+ *
+ * Estilo do objeto DOM com a imagem de aguarde existente no
+ * cabeçalho da janela.
+ */
+ aguarde : "",
+ /*
+ * Propriedade: dados
+ *
+ * Dados que serao utilizados. Pode ser passado como parametro.
+ *
+ * Default: {false}
+ */
+ dados : false,
+ /*
+ * Propriedade: titulo
+ *
+ * Título do gráfico. Se for vazio, será obtido do nome
+ * do tema selecionado
+ */
+ titulo : "",
+ /*
+ * Propriedade: tipo
+ *
+ * Tipo de gráfico escolhido pelo usuário.
+ */
+ tipo : "",
+ /*
+ * Propriedade: acumula
+ *
+ * Acumula os valores ao gerar o gráfico
+ *
+ * Type: {boolean}
+ *
+ * Default: {false}
+ */
+ acumula : false,
+ /*
+ * Propriedade: relativa
+ *
+ * Utiliza valores relativos ao criar o gráfico
+ *
+ * Type: {boolean}
+ *
+ * Default: {false}
+ */
+ relativa : false,
+ /*
+ * Propriedade: dadospuros
+ *
+ * Não faz nenhum tipo de processamento nos dados antes de gerar o
+ * gráfico
+ *
+ * Type: {boolean}
+ *
+ * Default: {false}
+ */
+ dadospuros : false,
+ /*
+ * Propriedade: navegacao
+ *
+ * Ativa ou não a navegação dinâmica do mapa
+ *
+ * Type: {boolean}
+ *
+ * Default: {false}
+ */
+ navegacao : false,
+
+ /*
+ * Para efeitos de compatibilidade antes da versão 4.7 que não
+ * tinha dicionário
+ */
+ criaJanelaFlutuante : function(dados) {
+ if (dados) {
+ i3GEOF.graficointerativo1.dados = dados;
+ }
+ i3GEOF.graficointerativo1.iniciaDicionario();
+ },
+ /*
+ * Function: iniciaDicionario
+ *
+ * Carrega o dicionário e chama a função que inicia a
+ * ferramenta
+ *
+ * O Javascript é carregado com o id
+ * i3GEOF.nomedaferramenta.dicionario_script
+ */
+ iniciaDicionario : function(dados) {
+ if (dados) {
+ i3GEOF.graficointerativo1.dados = dados;
+ }
+ if (typeof (i3GEOF.graficointerativo1.dicionario) === 'undefined') {
+ i3GEO.util.scriptTag(i3GEO.configura.locaplic
+ + "/ferramentas/graficointerativo1/dependencias.php",
+ "i3GEOF.graficointerativo1.iniciaJanelaFlutuante()",
+ "i3GEOF.graficointerativo1.dicionario_script");
+ } else {
+ i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados);
+ }
+ },
+ /*
+ * Function: inicia
+ *
+ * Inicia a ferramenta. É chamado por criaJanelaFlutuante
+ *
+ * Parametros:
+ *
+ * iddiv {String} - id do div que receberá o conteudo HTML da
+ * ferramenta
+ *
+ * dados {JSON} - dados para o gráfico (opcional) exemplo
+ * ["n;x","'Argentina';33796870","'Paraguay';4773464","'Brazil';151525400","'Chile';13772710"]
+ */
+ inicia : function(iddiv) {
+ // try{
+ $i(iddiv).innerHTML += i3GEOF.graficointerativo1.html();
+ $i("i3GEOgraficointerativo1Acumula").checked = i3GEOF.graficointerativo1.acumula;
+ $i("i3GEOgraficointerativo1Relativa").checked = i3GEOF.graficointerativo1.relativa;
+ $i("i3GEOgraficointerativo1DadosPuros").checked = i3GEOF.graficointerativo1.dadospuros;
+ if (i3GEOF.graficointerativo1.navegacao === true) {
+ i3GEOF.graficointerativo1.ativaNavegacao(true);
+ }
+ // eventos das guias
+ $i("i3GEOgraficointerativo1guia1").onclick = function() {
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
+ "i3GEOgraficointerativo1guia");
+ $i("i3GEOgraficointerativo1Grafico").style.display = "none";
+ };
+ $i("i3GEOgraficointerativo1guia2").onclick = function() {
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia2",
+ "i3GEOgraficointerativo1guia");
+ i3GEOF.graficointerativo1.configuraDados();
+ $i("i3GEOgraficointerativo1Grafico").style.display = "none";
+ };
+ $i("i3GEOgraficointerativo1guia3").onclick = function() {
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3",
+ "i3GEOgraficointerativo1guia");
+ $i("i3GEOgraficointerativo1Grafico").style.display = "none";
+ };
+ $i("i3GEOgraficointerativo1guia4").onclick = function() {
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia4",
+ "i3GEOgraficointerativo1guia");
+ var t = $i("i3GEOgraficointerativo1Grafico");
+ t.style.display = "block";
+ t.style.position = "relative";
+ t.style.top = "-5px";
+ t.visibility = "visible";
+ i3GEOF.graficointerativo1.tabela2dados();
+ };
+ $i("i3GEOgraficointerativo1guia5").onclick = function() {
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia5",
+ "i3GEOgraficointerativo1guia");
+ $i("i3GEOgraficointerativo1Grafico").style.display = "none";
+ $i("i3GEOgraficointerativo1guia5obj").innerHTML = "";
+ };
+
+ i3GEOF.graficointerativo1.ativaFoco();
+ i3GEOF.graficointerativo1.comboTemas();
+ new YAHOO.widget.Button("i3GEOgraficointerativo1botao1", {
+ onclick : {
+ fn : i3GEOF.graficointerativo1.obterDados
}
- },
- /*
- Function: inicia
-
- Inicia a ferramenta. É chamado por criaJanelaFlutuante
-
- Parametros:
-
- iddiv {String} - id do div que receberá o conteudo HTML da ferramenta
-
- dados {JSON} - dados para o gráfico (opcional) exemplo ["n;x","'Argentina';33796870","'Paraguay';4773464","'Brazil';151525400","'Chile';13772710"]
- */
- inicia: function(iddiv){
- //try{
- $i(iddiv).innerHTML += i3GEOF.graficointerativo1.html();
- $i("i3GEOgraficointerativo1Acumula").checked = i3GEOF.graficointerativo1.acumula;
- $i("i3GEOgraficointerativo1Relativa").checked = i3GEOF.graficointerativo1.relativa;
- $i("i3GEOgraficointerativo1DadosPuros").checked = i3GEOF.graficointerativo1.dadospuros;
- if(i3GEOF.graficointerativo1.navegacao === true)
- {i3GEOF.graficointerativo1.ativaNavegacao(true);}
- //eventos das guias
- $i("i3GEOgraficointerativo1guia1").onclick = function(){
- i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia");
- $i("i3GEOgraficointerativo1Grafico").style.display = "none";
- };
- $i("i3GEOgraficointerativo1guia2").onclick = function(){
- i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia2","i3GEOgraficointerativo1guia");
- i3GEOF.graficointerativo1.configuraDados();
- $i("i3GEOgraficointerativo1Grafico").style.display = "none";
- };
- $i("i3GEOgraficointerativo1guia3").onclick = function(){
- i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3","i3GEOgraficointerativo1guia");
- $i("i3GEOgraficointerativo1Grafico").style.display = "none";
- };
- $i("i3GEOgraficointerativo1guia4").onclick = function(){
- i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia4","i3GEOgraficointerativo1guia");
- var t = $i("i3GEOgraficointerativo1Grafico"),
- dados = i3GEOF.graficointerativo1.tabela2dados();
- t.style.display = "block";
- t.style.position = "relative";
- t.style.top = "-5px";
- t.visibility = "visible";
- };
- $i("i3GEOgraficointerativo1guia5").onclick = function(){
- i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia5","i3GEOgraficointerativo1guia");
- $i("i3GEOgraficointerativo1Grafico").style.display = "none";
- $i("i3GEOgraficointerativo1guia5obj").innerHTML = "";
- };
-
+ });
+ if (i3GEOF.graficointerativo1.dados
+ && i3GEOF.graficointerativo1.dados != "undefined") {
+ // i3GEOF.graficointerativo1.tipo = "pizza2d";
+ // var retorno =
+ // {"attributes":{"id":""},"data":{"dados":["n;x","'4';3839572","'8';81710320","'7';24631314","'2';10967753","'1';24496400","'3';18752482","'5';13574480","'6';216507515"]}};
+ i3GEOF.graficointerativo1
+ .montaTabelaDados(i3GEOF.graficointerativo1.dados);
+ $i("i3GEOgraficointerativo1guia4").onclick.call();
+ }
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
+ "i3GEOgraficointerativo1guia");
+ // }
+ // catch(erro){i3GEO.janela.tempoMsg(erro);}
+ },
+ /*
+ * Function: html
+ *
+ * Gera o código html para apresentação das
+ * opções da ferramenta
+ *
+ * Retorno:
+ *
+ * String com o código html
+ */
+ html : function() {
+ var locaplic = i3GEO.configura.locaplic, ins = ''
+ + ' '
+ + ''
+ + '
'
+ + $trad(4, i3GEOF.graficointerativo1.dicionario)
+ + ':
'
+ + '
'
+ + '
'
+ + ''
+ + '
'
+ + $trad(12, i3GEOF.graficointerativo1.dicionario)
+ + ':
'
+ + '
'
+ + $trad(13, i3GEOF.graficointerativo1.dicionario)
+ + ':
'
+ + '
'
+ + '
'
+ + '
'
+ + $trad(14, i3GEOF.graficointerativo1.dicionario)
+ + ':
'
+ + '
'
+ + '
'
+ + '
'
+ + '
'
+ + $trad(15, i3GEOF.graficointerativo1.dicionario)
+ + ':
'
+ + '
'
+ + '
'
+ + '
'
+ + $trad(16, i3GEOF.graficointerativo1.dicionario)
+ + ': '
+ + $inputText("", "", "i3GEOgraficointerativo1excluir", "", 3,
+ "")
+ + '
'
+ + $trad(17, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + '
'
+ + '
'
+ + $trad(19, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + ''
+ + '
'
+ + $trad(20, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(21, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(22, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(23, i3GEOF.graficointerativo1.dicionario)
+ + ' (%)
'
+ + '
'
+ + $trad(24, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(25, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(47, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(48, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(49, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+
+ + '
'
+ + $trad(26, i3GEOF.graficointerativo1.dicionario)
+ + ' '
+ + $trad(27, i3GEOF.graficointerativo1.dicionario)
+ + ' '
+ + $trad(28, i3GEOF.graficointerativo1.dicionario)
+ + '
'
+ + '
'
+ + $trad(29, i3GEOF.graficointerativo1.dicionario)
+ + '.
'
+ +
+
+ '
'
+ + ''
+ + ''
+ + '
'
+ + '
';
+ return ins;
+ },
+ /*
+ * Function: iniciaJanelaFlutuante
+ *
+ * Cria a janela flutuante para controle da ferramenta.
+ *
+ * Parametro
+ *
+ * dados {JSON} - dados para o gráfico
+ */
+ iniciaJanelaFlutuante : function(dados) {
+ if (dados) {
+ i3GEOF.graficointerativo1.dados = dados;
+ }
+ var minimiza, cabecalho, janela, divid, temp, titulo;
+ // cria a janela flutuante
+ cabecalho = function() {
i3GEOF.graficointerativo1.ativaFoco();
- i3GEOF.graficointerativo1.comboTemas();
- new YAHOO.widget.Button(
- "i3GEOgraficointerativo1botao1",
- {onclick:{fn: i3GEOF.graficointerativo1.obterDados}}
- );
- if(i3GEOF.graficointerativo1.dados && i3GEOF.graficointerativo1.dados != "undefined"){
- //i3GEOF.graficointerativo1.tipo = "pizza2d";
- //var retorno = {"attributes":{"id":""},"data":{"dados":["n;x","'4';3839572","'8';81710320","'7';24631314","'2';10967753","'1';24496400","'3';18752482","'5';13574480","'6';216507515"]}};
- i3GEOF.graficointerativo1.montaTabelaDados(i3GEOF.graficointerativo1.dados);
- $i("i3GEOgraficointerativo1guia4").onclick.call();
- }
- i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia");
- //}
- //catch(erro){i3GEO.janela.tempoMsg(erro);}
- },
- /*
- Function: html
-
- Gera o código html para apresentação das opções da ferramenta
-
- Retorno:
-
- String com o código html
- */
- html:function(){
- var locaplic = i3GEO.configura.locaplic,
- ins = '' +
- ' ' +
- '' +
- '
'+$trad(4,i3GEOF.graficointerativo1.dicionario)+':
' +
- '
' +
- '
' +
- '' +
- '
'+$trad(12,i3GEOF.graficointerativo1.dicionario)+':
' +
- '
'+$trad(13,i3GEOF.graficointerativo1.dicionario)+':
' +
- '
' +
- '
' +
- '
'+$trad(14,i3GEOF.graficointerativo1.dicionario)+':
' +
- '
' +
- '
'+
- '
'+
- '
'+$trad(15,i3GEOF.graficointerativo1.dicionario)+':
'+
- '
' +
- '
' +
- '
'+$trad(16,i3GEOF.graficointerativo1.dicionario)+': ' +
- $inputText("","","i3GEOgraficointerativo1excluir","",3,"") +
- '
'+$trad(17,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
'+
- '
'+
- '
'+$trad(19,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
' +
- '' +
- '
'+$trad(20,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
'+$trad(21,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
'+$trad(22,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
'+$trad(23,i3GEOF.graficointerativo1.dicionario)+' (%)
' +
- '
'+$trad(24,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
'+$trad(25,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
Atualiza o gráfico ao navegar pelo mapa
' +
- '
'+$trad(26,i3GEOF.graficointerativo1.dicionario)+' '+$trad(27,i3GEOF.graficointerativo1.dicionario)+' '+$trad(28,i3GEOF.graficointerativo1.dicionario)+'
' +
- '
'+$trad(29,i3GEOF.graficointerativo1.dicionario)+'.
' +
-
- '
'+
- '' +
- '' +
- '
' +
- '
';
- return ins;
- },
- /*
- Function: iniciaJanelaFlutuante
-
- Cria a janela flutuante para controle da ferramenta.
-
- Parametro
-
- dados {JSON} - dados para o gráfico
- */
- iniciaJanelaFlutuante: function(dados){
- if(dados){
- i3GEOF.graficointerativo1.dados = dados;
- }
- var minimiza,cabecalho,janela,divid,temp,titulo;
- //cria a janela flutuante
- cabecalho = function(){
- i3GEOF.graficointerativo1.ativaFoco();
- };
- minimiza = function(){
- i3GEO.janela.minimiza("i3GEOF.graficointerativo1");
+ };
+ minimiza = function() {
+ i3GEO.janela.minimiza("i3GEOF.graficointerativo1");
+ };
+ titulo = " "
+ + $trad("t37b")
+ + " ";
+ janela = i3GEO.janela.cria("380px", "310px", "", "", "", titulo,
+ "i3GEOF.graficointerativo1", false, "hd", cabecalho, minimiza);
+ divid = janela[2].id;
+ i3GEOF.graficointerativo1.aguarde = $i("i3GEOF.graficointerativo1_imagemCabecalho").style;
+ $i("i3GEOF.graficointerativo1_corpo").style.backgroundColor = "white";
+ $i("i3GEOF.graficointerativo1_corpo").style.overflow = "auto";
+ i3GEOF.graficointerativo1.inicia(divid);
+ if (i3GEO.Interface) {
+ temp = function() {
+ if (i3GEO.Interface.ATUAL !== "googlemaps"
+ && i3GEO.Interface.ATUAL !== "googleearth") {
+ i3GEO.eventos.NAVEGAMAPA
+ .remove("i3GEOF.graficointerativo1.obterDados()");
+ }
+ if (i3GEO.Interface.ATUAL == "googlemaps") {
+ google.maps.event.removeListener(graficointerativo1Dragend);
+ google.maps.event.removeListener(graficointerativo1Zoomend);
+ }
+ if (i3GEO.Interface.ATUAL === "googleearth") {
+ google.earth.removeEventListener(graficointerativo1Dragend);
+ }
+ if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search(
+ "i3GEOF.graficointerativo1.comboTemas()") > 0) {
+ i3GEO.eventos.ATUALIZAARVORECAMADAS
+ .remove("i3GEOF.graficointerativo1.comboTemas()");
+ }
};
- titulo = " "+$trad("t37b")+" ";
- janela = i3GEO.janela.cria(
- "380px",
- "310px",
- "",
- "",
- "",
- titulo,
- "i3GEOF.graficointerativo1",
- false,
- "hd",
- cabecalho,
- minimiza
- );
- divid = janela[2].id;
- i3GEOF.graficointerativo1.aguarde = $i("i3GEOF.graficointerativo1_imagemCabecalho").style;
- $i("i3GEOF.graficointerativo1_corpo").style.backgroundColor = "white";
- $i("i3GEOF.graficointerativo1_corpo").style.overflow = "auto";
- i3GEOF.graficointerativo1.inicia(divid);
- if(i3GEO.Interface){
- temp = function(){
- if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){
- i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.obterDados()");
- }
- if(i3GEO.Interface.ATUAL == "googlemaps"){
- google.maps.event.removeListener(graficointerativo1Dragend);
- google.maps.event.removeListener(graficointerativo1Zoomend);
- }
- if(i3GEO.Interface.ATUAL === "googleearth"){
- google.earth.removeEventListener(graficointerativo1Dragend);
- }
- if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.graficointerativo1.comboTemas()") > 0)
- {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.graficointerativo1.comboTemas()");}
- };
- YAHOO.util.Event.addListener(janela[0].close, "click", temp);
- if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.graficointerativo1.comboTemas()") < 0)
- {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.graficointerativo1.comboTemas()");}
+ YAHOO.util.Event.addListener(janela[0].close, "click", temp);
+ if (i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search(
+ "i3GEOF.graficointerativo1.comboTemas()") < 0) {
+ i3GEO.eventos.ATUALIZAARVORECAMADAS
+ .push("i3GEOF.graficointerativo1.comboTemas()");
}
- },
- /*
- Function: ativaFoco
-
- Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado
- */
- ativaFoco: function(){
- if(i3GEO.Interface){
- i3GEO.barraDeBotoes.ativaIcone("graficointerativo1");
+ }
+ },
+ /*
+ * Function: ativaFoco
+ *
+ * Refaz a interface da ferramenta quando a janela flutuante tem seu foco
+ * ativado
+ */
+ ativaFoco : function() {
+ if (i3GEO.Interface) {
+ i3GEO.barraDeBotoes.ativaIcone("graficointerativo1");
+ }
+ var i = $i("i3GEOF.graficointerativo1_c").style;
+ i3GEO.janela.ULTIMOZINDEX++;
+ i.zIndex = i3GEO.janela.ULTIMOZINDEX;
+ },
+ novaJanela : function() {
+ var janela = "", divid, g = $i("i3GEOgraficointerativo1guia4objCanvas"), v = g
+ .cloneNode(true), cabecalho = function() {
+ }, id = YAHOO.util.Dom.generateId(), minimiza = function() {
+ i3GEO.janela.minimiza(id);
+ }, titulo = " " + i3GEOF.graficointerativo1.titulo;
+ janela = i3GEO.janela.cria("380px", "280px", "", "", "", titulo, id,
+ false, "hd", cabecalho, minimiza);
+ divid = janela[2].id;
+ $i(divid).style.marginTop = "0px";
+ v.id = id + "ngrafico";
+ v.style.marginTop = "0px";
+ $i(divid).appendChild(v);
+ },
+ /*
+ * Function: comboTemas
+ *
+ * Monta o combo para escolha do tema que será utilizado no
+ * gráfico
+ */
+ comboTemas : function() {
+ if (!i3GEO.Interface) {
+ return;
+ }
+ i3GEO.util
+ .comboTemas(
+ "i3GEOgraficointerativo1ComboTemasId",
+ function(retorno) {
+ $i("i3GEOgraficointerativo1ComboTemas").innerHTML = retorno.dados;
+ $i("i3GEOgraficointerativo1ComboTemas").style.display = "block";
+ if ($i("i3GEOgraficointerativo1ComboTemasId")) {
+ $i("i3GEOgraficointerativo1ComboTemasId").onchange = function() {
+ i3GEO.mapa
+ .ativaTema($i("i3GEOgraficointerativo1ComboTemasId").value);
+ i3GEOF.graficointerativo1.comboItensSel();
+ };
+ }
+ if (i3GEO.temaAtivo !== "") {
+ $i("i3GEOgraficointerativo1ComboTemasId").value = i3GEO.temaAtivo;
+ $i("i3GEOgraficointerativo1ComboTemasId").onchange
+ .call();
+ }
+ }, "i3GEOgraficointerativo1ComboTemas", "", false,
+ "ligados", "font-size:12px;width:350px");
+ },
+ /*
+ * Function: ativaTipo
+ *
+ * Define a variável com o tipo de gráfico e mostra a guia 2
+ */
+ ativaTipo : function(obj) {
+ i3GEOF.graficointerativo1.tipo = obj.value;
+ if ($i("i3GEOgraficointerativo1Grafico").innerHTML === ""
+ || $i("i3GEOgraficointerativo1tabeladados").innerHTML == "") {
+ $i("i3GEOgraficointerativo1guia2").onclick.call();
+ } else {
+ $i("i3GEOgraficointerativo1guia4").onclick.call();
+ }
+ },
+ /*
+ * Function: configuraDados
+ *
+ * Configura o formulário para obtenção dos dados para
+ * cada tipo de gráfico
+ */
+ configuraDados : function() {
+ var ativa = function(comboxlinha, comboylinha, ajudapizza) {
+ try {
+ $i("i3GEOgraficointerativo1ComboXlinha").style.display = comboxlinha;
+ $i("i3GEOgraficointerativo1ComboYlinha").style.display = comboylinha;
+ $i("i3GEOgraficointerativo1AjudaPizza").style.display = ajudapizza;
+ } catch (e) {
}
- var i = $i("i3GEOF.graficointerativo1_c").style;
- i3GEO.janela.ULTIMOZINDEX++;
- i.zIndex = i3GEO.janela.ULTIMOZINDEX;
- },
- novaJanela: function(){
- var janela = "",
- divid,
- g = $i("i3GEOgraficointerativo1guia4objCanvas"),
- v = g.cloneNode(true),
- cabecalho = function(){},
- id = YAHOO.util.Dom.generateId(),
- minimiza = function(){
- i3GEO.janela.minimiza(id);
- },
- titulo = " "+i3GEOF.graficointerativo1.titulo;
- janela = i3GEO.janela.cria(
- "380px",
- "280px",
- "",
- "",
- "",
- titulo,
- id,
- false,
- "hd",
- cabecalho,
- minimiza
- );
- divid = janela[2].id;
- $i(divid).style.marginTop = "0px";
- v.id = id+"ngrafico";
- v.style.marginTop = "0px";
- $i(divid).appendChild(v);
- },
- /*
- Function: comboTemas
-
- Monta o combo para escolha do tema que será utilizado no gráfico
- */
- comboTemas: function(){
- if(!i3GEO.Interface){return;}
- i3GEO.util.comboTemas(
- "i3GEOgraficointerativo1ComboTemasId",
- function(retorno){
- $i("i3GEOgraficointerativo1ComboTemas").innerHTML = retorno.dados;
- $i("i3GEOgraficointerativo1ComboTemas").style.display = "block";
- if ($i("i3GEOgraficointerativo1ComboTemasId")){
- $i("i3GEOgraficointerativo1ComboTemasId").onchange = function(){
- i3GEO.mapa.ativaTema($i("i3GEOgraficointerativo1ComboTemasId").value);
- i3GEOF.graficointerativo1.comboItensSel();
- };
- }
- if(i3GEO.temaAtivo !== ""){
- $i("i3GEOgraficointerativo1ComboTemasId").value = i3GEO.temaAtivo;
- $i("i3GEOgraficointerativo1ComboTemasId").onchange.call();
- }
- },
- "i3GEOgraficointerativo1ComboTemas",
- "",
- false,
- "ligados",
- "font-size:12px;width:350px"
- );
- },
- /*
- Function: ativaTipo
-
- Define a variável com o tipo de gráfico e mostra a guia 2
- */
- ativaTipo: function(obj){
- i3GEOF.graficointerativo1.tipo = obj.value;
- if($i("i3GEOgraficointerativo1Grafico").innerHTML === "" || $i("i3GEOgraficointerativo1tabeladados").innerHTML == "")
- {$i("i3GEOgraficointerativo1guia2").onclick.call();}
- else
- {$i("i3GEOgraficointerativo1guia4").onclick.call();}
- },
- /*
- Function: configuraDados
-
- Configura o formulário para obtenção dos dados para cada tipo de gráfico
- */
- configuraDados: function(){
- var ativa = function(comboxlinha,comboylinha,ajudapizza){
- try{
- $i("i3GEOgraficointerativo1ComboXlinha").style.display = comboxlinha;
- $i("i3GEOgraficointerativo1ComboYlinha").style.display = comboylinha;
- $i("i3GEOgraficointerativo1AjudaPizza").style.display = ajudapizza;
- }catch(e){}
- };
- if (i3GEOF.graficointerativo1.tipo === ""){
- i3GEO.janela.tempoMsg($trad(31,i3GEOF.graficointerativo1.dicionario));
- i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia");
- return;
+ };
+ if (i3GEOF.graficointerativo1.tipo === "") {
+ i3GEO.janela.tempoMsg($trad(31,
+ i3GEOF.graficointerativo1.dicionario));
+ i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
+ "i3GEOgraficointerativo1guia");
+ return;
+ }
+ if (i3GEOF.graficointerativo1.tipo === "pizza2d") {
+ ativa.call("block", "block", "block");
+ }
+ },
+ /*
+ * Function: comboItensSel
+ *
+ * Cria um combo para selecionar os itens do tema escolhido
+ *
+ * Veja:
+ *
+ *
+ */
+ comboItensSel : function() {
+ var tema = $i("i3GEOgraficointerativo1ComboTemasId").value;
+ i3GEO.util
+ .comboItens(
+ "i3GEOgraficointerativo1ComboXid",
+ tema,
+ function(retorno) {
+ if (retorno.tipo === "erro") {
+ $i("i3GEOgraficointerativo1ComboX").innerHTML = ""
+ + $trad(
+ 32,
+ i3GEOF.graficointerativo1.dicionario)
+ + " ";
+ $i("i3GEOgraficointerativo1ComboY").innerHTML = ""
+ + $trad(
+ 32,
+ i3GEOF.graficointerativo1.dicionario)
+ + " ";
+ } else {
+ $i("i3GEOgraficointerativo1ComboY").innerHTML = ""
+ + retorno.dados
+ + "
";
+ $i("i3GEOgraficointerativo1ComboXid").id = "i3GEOgraficointerativo1ComboYid";
+ $i("i3GEOgraficointerativo1ComboX").innerHTML = ""
+ + retorno.dados
+ + "
";
+ $i("i3GEOgraficointerativo1ComboXid").style.width = "160px";
+ $i("i3GEOgraficointerativo1ComboYid").style.width = "160px";
+
+ $i("i3GEOgraficointerativo1ComboXid").onchange = function() {
+ $i(this.id + "Titulo").value = this.options[this.selectedIndex].label;
+ };
+ var adicionaFilho = function() {
+ var no = document.createElement("div"), tit = $i(this.id
+ + "Titulo"), novoselect;
+ if (tit) {
+ tit.value = this.options[this.selectedIndex].label;
+ }
+ no.innerHTML = retorno.dados + " ";
+ novoselect = no.getElementsByTagName("select")[0];
+ novoselect.id = "";
+ novoselect.onchange = adicionaFilho;
+ novoselect.style.width = "160px";
+ $i("i3GEOgraficointerativo1ComboY").appendChild(no);
+ };
+ $i("i3GEOgraficointerativo1ComboYid").onchange = adicionaFilho;
+ }
+ }, "i3GEOgraficointerativo1ComboX", "");
+ },
+ /*
+ * Function: obterDados
+ *
+ * Obtém os dados que serão utilizados no gráfico
+ *
+ * Veja:
+ *
+ *
+ */
+ obterDados : function() {
+ if (!i3GEO.Interface) {
+ return;
+ }
+ if (i3GEOF.graficointerativo1.aguarde.visibility === "visible") {
+ return;
+ }
+ 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;
+
+ // pega os itens
+ temp = $i("i3GEOgraficointerativo1ComboX");
+ x = temp.getElementsByTagName("select")[0].value;
+ temp = $i("i3GEOgraficointerativo1ComboY");
+ temp = temp.getElementsByTagName("select");
+ n = temp.length;
+ if (n === 1) {
+ y = temp[0].value;
+ } else {
+ y = [];
+ for (i = 0; i < n; i++) {
+ if (temp[i].value != "") {
+ y.push(temp[i].value);
+ }
}
- if(i3GEOF.graficointerativo1.tipo === "pizza2d"){
- ativa.call("block","block","block");
+ y = y.join(",");
+ }
+ 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;
+
+ if ($i("i3GEOgraficointerativo1DadosPuros").checked) {
+ tipo = "nenhum";
+ } else {
+ if (x === y) {
+ tipo = "conta";
}
- },
- /*
- Function: comboItensSel
-
- Cria um combo para selecionar os itens do tema escolhido
-
- Veja:
-
-
- */
- comboItensSel: function(){
- var tema = $i("i3GEOgraficointerativo1ComboTemasId").value;
- i3GEO.util.comboItens(
- "i3GEOgraficointerativo1ComboXid",
- tema,
- function(retorno){
- if(retorno.tipo === "erro"){
- $i("i3GEOgraficointerativo1ComboX").innerHTML = ""+$trad(32,i3GEOF.graficointerativo1.dicionario)+" ";
- $i("i3GEOgraficointerativo1ComboY").innerHTML = ""+$trad(32,i3GEOF.graficointerativo1.dicionario)+" ";
- }
- else{
- $i("i3GEOgraficointerativo1ComboY").innerHTML = retorno.dados + " ";
- $i("i3GEOgraficointerativo1ComboXid").id = "i3GEOgraficointerativo1ComboYid";
- $i("i3GEOgraficointerativo1ComboX").innerHTML = retorno.dados + " ";
- $i("i3GEOgraficointerativo1ComboXid").style.width = "160px";
- $i("i3GEOgraficointerativo1ComboYid").style.width = "160px";
- $i("i3GEOgraficointerativo1ComboXid").onchange = function(){
- var combo = $i("i3GEOgraficointerativo1ComboXid");
- $i("i3GEOgraficointerativo1ComboXidTitulo").value = combo.options[combo.selectedIndex].label;
- };
- $i("i3GEOgraficointerativo1ComboYid").onchange = function(){
- var combo = $i("i3GEOgraficointerativo1ComboYid");
- $i("i3GEOgraficointerativo1ComboYidTitulo").value = combo.options[combo.selectedIndex].label;
- };
- }
- },
- "i3GEOgraficointerativo1ComboX",
- ""
- );
- },
- /*
- Function: obterDados
-
- Obtém os dados que serão utilizados no gráfico
-
- Veja:
+ }
+ if (!$i("i3GEOgraficointerativo1OrdenaX").checked) {
+ ordenax = "nao";
+ }
-
- */
- obterDados: function(){
- if(!i3GEO.Interface){
- return;
+ if (tema === "") {
+ i3GEO.janela.tempoMsg($trad(34,
+ i3GEOF.graficointerativo1.dicionario));
+ return;
+ }
+ if (x === "") {
+ i3GEO.janela.tempoMsg($trad(35,
+ i3GEOF.graficointerativo1.dicionario));
+ return;
+ }
+ if (y === "") {
+ i3GEO.janela.tempoMsg($trad(36,
+ i3GEOF.graficointerativo1.dicionario));
+ return;
+ }
+ monta = function(retorno) {
+ i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
+ i3GEOF.graficointerativo1.montaTabelaDados(retorno);
+ $i("i3GEOgraficointerativo1guia4").onclick.call();
+ // verifica para nao ficar mostrando a janela toda vez que redesenha
+ // o mapa
+ if ($i("i3GEOFgraficointerativo1ativaNavegacao").checked == false) {
+ i3GEO.janela.tempoMsg($trad(37,
+ i3GEOF.graficointerativo1.dicionario));
}
- if(i3GEOF.graficointerativo1.aguarde.visibility === "visible")
- {return;}
- var tema = $i("i3GEOgraficointerativo1ComboTemasId").value,
- x = $i("i3GEOgraficointerativo1ComboXid").value,
- y = $i("i3GEOgraficointerativo1ComboYid").value,
- excluir = $i("i3GEOgraficointerativo1excluir").value,
- 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,
- cp = new cpaint(),
- tipo = $i("i3GEOgraficointerativo1TipoAgregacao").value,
- ordenax = "sim",
- monta;
-
- if($i("i3GEOgraficointerativo1DadosPuros").checked)
- {tipo = "nenhum";}
- else{
- if(x === y)
- {tipo = "conta";}
+ };
+ i3GEOF.graficointerativo1.aguarde.visibility = "visible";
+ cp.set_response_type("JSON");
+ cp.call(p + "&tipo=" + tipo + "&ordenax=" + ordenax, "graficoSelecao",
+ monta);
+ },
+ /*
+ * Pega os nomes das colunas
+ */
+ nomesColunas: function(){
+ //pega os nomes das clunas
+ var i,n,
+ temp = $i("i3GEOgraficointerativo1ComboX"),
+ colunas = [];
+ colunas.push(temp.getElementsByTagName("select")[0].value);
+ temp = $i("i3GEOgraficointerativo1ComboY");
+ temp = temp.getElementsByTagName("select");
+ n = temp.length;
+ for(i=0;i"+$trad(38,i3GEOF.graficointerativo1.dicionario)+"
");
- ins.push(" "+$trad(39,i3GEOF.graficointerativo1.dicionario)+" ");
- ins.push(" "+$trad(40,i3GEOF.graficointerativo1.dicionario)+" ");
- ins.push(""+$trad(41,i3GEOF.graficointerativo1.dicionario)+" ");
- for (i=1;i");
- ins.push(" ");
- ins.push("");
- ins.push($inputText("","",id+"_nome",$trad(43,i3GEOF.graficointerativo1.dicionario),20,v[0],"nome"));
- ins.push(" ");
- ins.push($inputText("","",id+"_valor",$trad(44,i3GEOF.graficointerativo1.dicionario),12,v[1],"valor"));
- ins.push(" ");
- if($i("i3GEOgraficointerativo1CoresA").checked){
- cor = i3GEO.util.rgb2hex(i3GEO.util.randomRGB());
- }
- //verifica se no objeto com os dados existe um terceiro valor com as cores
- if(v[2]){
- cor = i3GEO.util.rgb2hex(v[2]);
- }
- ins.push($inputText("","",id+"_cor","",12,cor,$trad(41,i3GEOF.graficointerativo1.dicionario)));
- ins.push(" ");
- ins.push(" ");
- ins.push(" ");
+ if (!retorno.dados && retorno.data != undefined) {
+ dados = retorno.data.dados;
+ } else {
+ dados = retorno;
+ }
+ ins.push(""
+ + $trad(38, i3GEOF.graficointerativo1.dicionario)
+ + "
");
+ //pega os nomes das clunas
+ colunas = i3GEOF.graficointerativo1.nomesColunas();
+ ncolunas = colunas.length;
+ for(i=0;i "
+ + colunas[i]
+ + "");
+ }
+ ins.push(""
+ + $trad(41, i3GEOF.graficointerativo1.dicionario)
+ + " ");
+ n = dados.length;
+ for (i = 1; i < n; i++) {
+ v = dados[i].split(";");
+ // ins += v[0]+" "+v[1];
+ id = "i3GEOgraficointerativo1Dados" + i; // layer+indice da classe
+ ins.push("");
+ ins.push(" ");
+ ins.push("");
+ for(j=0;j");
+ ins.push($inputText("", "", id + colunas[j], $trad(43,
+ i3GEOF.graficointerativo1.dicionario), 20, v[j], colunas[j]));
+ ins.push("");
}
- ins.push("
");
- $i("i3GEOgraficointerativo1Dados").innerHTML = ins.join("");
- },
- /*
- Function: tabela2csv
- Obtém os dados da tabela em CSV
- */
- tabela2csv: function(){
- var inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"),
+ ins.push("");
+ if ($i("i3GEOgraficointerativo1CoresA").checked) {
+ cor = i3GEO.util.rgb2hex(i3GEO.util.randomRGB());
+ }
+ // verifica se no objeto com os dados existe um terceiro valor com
+ // as cores
+ if (v[ncolunas + 1]) {
+ cor = i3GEO.util.rgb2hex(v[ncolunas + 1]);
+ }
+ ins.push($inputText("", "", id + "_cor", "", 12, cor, $trad(41,
+ i3GEOF.graficointerativo1.dicionario)));
+ ins.push(" ");
+ ins.push(" ");
+ ins.push(" ");
+ }
+ ins.push("
");
+ $i("i3GEOgraficointerativo1Dados").innerHTML = ins.join("");
+ },
+ /*
+ * Function: tabela2csv
+ *
+ * Obtém os dados da tabela em CSV
+ */
+ tabela2csv : function() {
+ var inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"),
ninputs = inputs.length,
i,
legendaX = "",
legendaY = "",
csv = [];
- if($i("i3GEOgraficointerativo1ComboXid"))
- {legendaX = $i("i3GEOgraficointerativo1ComboXid").value;}
- if($i("i3GEOgraficointerativo1ComboYid"))
- {legendaY = $i("i3GEOgraficointerativo1ComboYid").value;}
- csv.push(legendaX+";"+legendaY);
- for(i=0;i maior)
- {maior = temp;}
- if(temp < menor)
- {menor = temp;}
- temp = inputs[i].value * 1;
- if(temp > maiorNome)
- {maiorNome = temp;}
- if(temp < menorNome)
- {menorNome = temp;}
- //par.push({"value":inputs[i+1].value * 1,"label":inputs[i].value+" "});
- par.push([inputs[i].value+" ",inputs[i+1].value * 1]);
- temp = inputs[i+1].value * 1;
- if($i("i3GEOgraficointerativo1Acumula").checked)
- {temp = acum;}
- if($i("i3GEOgraficointerativo1Relativa").checked)
- {temp = (temp * 100) / total;}
- //parcor.push({"colour":inputs[i+2].value,"value":temp,"label":inputs[i].value+" "});
- parcor.push([inputs[i].value+" ",temp,inputs[i+2].value]);
- }
- if($i("i3GEOgraficointerativo1Acumula").checked){
- valores = acumulado;
- maior = soma;
+ if (temp > maior) {
+ maior = temp;
+ }
+ if (temp < menor) {
+ menor = temp;
+ }
+ temp = inputs[i + 1].value * 1;
+ if ($i("i3GEOgraficointerativo1Acumula").checked) {
+ temp = acum;
+ }
+ if ($i("i3GEOgraficointerativo1Relativa").checked) {
+ temp = (temp * 100) / total;
+ }
+ par.push([ inputs[i].value + " ", temp ]);
}
- if(legendaX == legendaY){
- menor = 0;
- legendaX += " ("+$trad(45,i3GEOF.graficointerativo1.dicionario)+")";
- legendaY += " ("+$trad(46,i3GEOF.graficointerativo1.dicionario)+")";
+ if ($i("i3GEOgraficointerativo1Acumula").checked) {
+ maior = 0;
}
- if($i("i3GEOgraficointerativo1Relativa").checked){
- n = valores.length;
- for(i=0;i 0);
- p.parentNode.removeChild(p);
- },
- /*
- Function: corj
-
- Abre a janela para o usuário selecionar uma cor interativamente
- */
- corj: function(obj)
- {i3GEO.util.abreCor("",obj,"hex");},
- /*
- Function: ordenaColuna
-
- Ordena uma coluna da tabela
- */
- ordenaColuna: function(coluna,cid){
- try{
- var tabela = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("table")[0],
- trs = tabela.getElementsByTagName("tr"),
- ntrs = trs.length,
- psort = [],
- t = 0,
- npsortfim,
- ins = "",
- p = 0,
- e,
- temp,
- chaves = [],
- numero = false;
+ cores = "";
+ }
+ if (legendaX == legendaY) {
+ menor = 0;
+ legendaX += " (" + $trad(45, i3GEOF.graficointerativo1.dicionario)
+ + ")";
+ legendaY += " (" + $trad(46, i3GEOF.graficointerativo1.dicionario)
+ + ")";
+ }
- function sortNumber(a,b)
- {return a - b;}
- for(t=1;t";
- npsortfim = psort.length;
- for (p=0;p" + trs[e].innerHTML + "";}
+ for(j=0;j 0);
+ p.parentNode.removeChild(p);
+ },
+ /*
+ * Function: corj
+ *
+ * Abre a janela para o usuário selecionar uma cor interativamente
+ */
+ corj : function(obj) {
+ i3GEO.util.abreCor("", obj, "hex");
+ },
+ /*
+ * Function: ordenaColuna
+ *
+ * Ordena uma coluna da tabela
+ */
+ ordenaColuna : function(coluna, cid) {
+ var tabela = $i("i3GEOgraficointerativo1Dados").getElementsByTagName(
+ "table")[0], trs, ntrs = 0, psort = [], t = 0, ins = "", p = 0, e, temp, chaves = [], numero = false;
+
+ trs = tabela.getElementsByTagName("tr");
+ ntrs = trs.length;
+
+ function sortNumber(a, b) {
+ return a - b;
+ }
+ for (t = 1; t < ntrs; t++) {
+ temp = trs[t].childNodes[cid];
+ if (temp) {
+ psort.push(temp.childNodes[0].value);
+ chaves[temp.childNodes[0].value] = t;
+ if (temp.childNodes[0].value * 1) {
+ numero = true;
}
- tabela.innerHTML = ins;
}
- catch(e){}
- },
- /*
- Function: ativaNavegacao
-
- Ativa ou desativa a atualização automática ao navegar no mapa
- */
- ativaNavegacao: function(obj){
- if(!i3GEO.Interface){
- return;
+ }
+ // recosntroi a tabela
+ if (numero === true) {
+ psort = psort.sort(sortNumber);
+ } else {
+ psort = psort.sort();
+ }
+ ins = "" + trs[0].innerHTML + " ";
+ for (p = 0; p < psort; p++) {
+ e = chaves[psort[p]];
+ if (trs[e] !== undefined) {
+ ins += "" + trs[e].innerHTML + " ";
}
- if(obj === true){
- if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){
- i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo1.obterDados()");
- }
- if(i3GEO.Interface.ATUAL === "googlemaps"){
- graficointerativo1Dragend = GEvent.addListener(i3GeoMap, "dragend", function() {i3GEOF.graficointerativo1.obterDados();});
- graficointerativo1Zoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {i3GEOF.graficointerativo1.obterDados();});
- }
- if(i3GEO.Interface.ATUAL === "googleearth"){
- graficointerativo1Dragend = google.earth.addEventListener(i3GeoMap.getView(), "viewchangeend", function() {i3GEOF.graficointerativo1.obterDados();});
- }
+ }
+ tabela.innerHTML = ins;
+ },
+ /*
+ * Function: ativaNavegacao
+ *
+ * Ativa ou desativa a atualização automática ao
+ * navegar no mapa
+ */
+ ativaNavegacao : function(obj) {
+ if (!i3GEO.Interface) {
+ return;
+ }
+ if (obj === true) {
+ if (i3GEO.Interface.ATUAL !== "googlemaps"
+ && i3GEO.Interface.ATUAL !== "googleearth") {
+ i3GEO.eventos.NAVEGAMAPA
+ .push("i3GEOF.graficointerativo1.obterDados()");
}
- else{
- if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){
- i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.obterDados()");
- }
- if(i3GEO.Interface.ATUAL === "googlemaps"){
- GEvent.removeListener(graficointerativo1Dragend);
- GEvent.removeListener(graficointerativo1Zoomend);
- }
- if(i3GEO.Interface.ATUAL === "googleearth"){
- google.earth.removeEventListener(graficointerativo1Dragend);
- }
+ if (i3GEO.Interface.ATUAL === "googlemaps") {
+ graficointerativo1Dragend = GEvent.addListener(i3GeoMap,
+ "dragend", function() {
+ i3GEOF.graficointerativo1.obterDados();
+ });
+ graficointerativo1Zoomend = GEvent.addListener(i3GeoMap,
+ "zoomend", function() {
+ i3GEOF.graficointerativo1.obterDados();
+ });
}
- },
- configDefault: function(dados,maior,cores,legendaY,legendaX){
- var config = {
- canvas : "i3GEOgraficointerativo1guia4objCanvas",
- width : dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
- height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
- orthoAxisTitle: legendaY,
- orthoAxisFixedMax: maior,
- valuesFont : 'normal 9px sans-serif ',
- baseAxisTitle: legendaX,
- baseAxisTitleAlign: 'left',
- tooltipEnabled : true,
- tooltipArrowVisible: true,
- tooltipFade : false,
- tooltipFollowMouse : false,
- tooltipFormat : function(scene) {
- var cat = this.scene.datum.atoms['category'].value,
- val = this.scene.datum.atoms['value'].value;
- return ""+cat+" " + format( "#.###,", val);
- },
- baseAxisTitleFont : '9px sans-serif',
- yAxisTickFormatter: function(valor){
- valor = valor+"";
- valor = format( "#.###,", valor);
- return valor;
- },
- valueFormat: function(valor){
- valor = valor+"";
- valor = format( "#.###,", valor);
- return valor;
- },
- valuesAnchor : 'top',
- valuesVisible: false,
- orthoAxisOriginIsZero:false,
- titleAlign : 'center',
- orientation: 'vertical',
- baseAxisTicks: true,
- stacked : false,
- animate : true,
- hoverable: false,
- axisGrid: true,
- contentMargins :5,
- axisOffset: 0.02,
- panelSizeRatio : 0.8,
- orthoAxisLabelSpacingMin : 2 ,
- selectable : false,
- extensionPoints: {
- continuousAxisTicks_strokeStyle: 'gray',
- axisGrid_strokeStyle: 'lightgray',
- xAxisLabel_textStyle: 'black',
- label_textBaseline: "bottom",
- xAxisLabel_font: 'normal 10px sans-serif'
- }
- };
- return config;
- },
- barras: function(dados,maior,cores,legendaY,legendaX,xInclinado,tipo){
- config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
- config.extensionPoints.bar_fillStyle = function(d) {
- return cores[this.index];
+ if (i3GEO.Interface.ATUAL === "googleearth") {
+ graficointerativo1Dragend = google.earth.addEventListener(
+ i3GeoMap.getView(), "viewchangeend", function() {
+ i3GEOF.graficointerativo1.obterDados();
+ });
}
- if(tipo === "horizontal"){
- config.orientation = 'horizontal';
+ } else {
+ if (i3GEO.Interface.ATUAL !== "googlemaps"
+ && i3GEO.Interface.ATUAL !== "googleearth") {
+ i3GEO.eventos.NAVEGAMAPA
+ .remove("i3GEOF.graficointerativo1.obterDados()");
}
- if(xInclinado == true){
- config.extensionPoints.xAxisLabel_textAngle = -Math.PI/3;
- config.extensionPoints.xAxisLabel_textBaseline = 'top';
- config.extensionPoints.xAxisLabel_textAlign = 'right';
+ if (i3GEO.Interface.ATUAL === "googlemaps") {
+ GEvent.removeListener(graficointerativo1Dragend);
+ GEvent.removeListener(graficointerativo1Zoomend);
}
- new pvc.BarChart(
- config
- ).setData(dados, {
- crosstabMode : false
- }).render();
- i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
- },
- linhas: function(dados,maior,cores,legendaY,legendaX,xInclinado,tipo){
- config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
- if(xInclinado == true){
- config.extensionPoints.xAxisLabel_textAngle = -Math.PI/3;
- config.extensionPoints.xAxisLabel_textBaseline = 'top';
- config.extensionPoints.xAxisLabel_textAlign = 'right';
+ if (i3GEO.Interface.ATUAL === "googleearth") {
+ google.earth.removeEventListener(graficointerativo1Dragend);
}
- config.dotsVisible = true;
- new pvc.LineChart(
- config
- ).setData(dados, {
- crosstabMode : false
- }).render();
- i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
- },
- areas: function(dados,maior,cores,legendaY,legendaX,xInclinado,tipo){
- config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
- if(xInclinado == true){
- config.extensionPoints.xAxisLabel_textAngle = -Math.PI/3;
- config.extensionPoints.xAxisLabel_textBaseline = 'top';
- config.extensionPoints.xAxisLabel_textAlign = 'right';
+ }
+ },
+ configDefault : function(dados, maior, cores, legendaY, legendaX) {
+ var config = {
+ canvas : "i3GEOgraficointerativo1guia4objCanvas",
+ width : dados.resultset.length
+ * $i("i3GEOgraficointerativo1FatorTamanho").value,
+ height : parseInt(
+ $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
+ orthoAxisTitle : legendaY,
+ valuesFont : 'normal 9px sans-serif ',
+ baseAxisTitle : legendaX,
+ baseAxisTitleAlign : 'left',
+ tooltipEnabled : true,
+ tooltipArrowVisible : true,
+ tooltipFade : false,
+ tooltipFollowMouse : false,
+ tooltipFormat : function(scene) {
+ var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;
+ return "" + cat + " "
+ + format("#.###,", val);
+ },
+ baseAxisTitleFont : '9px sans-serif',
+ yAxisTickFormatter : function(valor) {
+ valor = valor + "";
+ valor = format("#.###,", valor);
+ return valor;
+ },
+ valueFormat : function(valor) {
+ valor = valor + "";
+ valor = format("#.###,", valor);
+ return valor;
+ },
+ valuesAnchor : 'top',
+ valuesVisible : false,
+ orthoAxisOriginIsZero : false,
+ titleAlign : 'center',
+ orientation : 'vertical',
+ baseAxisTicks : true,
+ stacked : false,
+ animate : true,
+ hoverable : false,
+ axisGrid : true,
+ contentMargins : 5,
+ axisOffset : 0.02,
+ panelSizeRatio : 0.8,
+ orthoAxisLabelSpacingMin : 2,
+ selectable : false,
+ extensionPoints : {
+ continuousAxisTicks_strokeStyle : 'gray',
+ axisGrid_strokeStyle : 'lightgray',
+ xAxisLabel_textStyle : 'black',
+ label_textBaseline : "bottom",
+ xAxisLabel_font : 'normal 10px sans-serif'
}
- config.dotsVisible = true;
- config.areasVisible = true;
- new pvc.LineChart(
- config
- ).setData(dados, {
- crosstabMode : false
- }).render();
- i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
- },
- arvores: function(dados,maior,cores,legendaY,legendaX,tipo){
- //config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
- //config.rootCategoryLabel = legendaX;
- config = {
- canvas: "i3GEOgraficointerativo1guia4objCanvas",
- width: dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
- height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
- title: legendaY,
- titleFont: 'italic 14px sans-serif',
- selectable: true,
- hoverable: true,
- legend: false,
- tooltipEnabled : true,
- legendPosition: 'right',
- rootCategoryLabel: legendaX,
- colors: cores,
- tooltipFormat : function(scene) {
- var cat = this.scene.datum.atoms['category'].value,
- val = this.scene.datum.atoms.size.value;
- return ""+cat+" " + format( "#.###,", val);
- }
- };
- new pvc.TreemapChart(
- config
- ).setData(dados, {
- crosstabMode : false
- }).render();
- i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
- },
- pizzas: function(dados,maior,cores,legendaY,legendaX,tipo){
- config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
- var config = {
- canvas : "i3GEOgraficointerativo1guia4objCanvas",
- width : dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
- height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
- animate: true,
- selectable: true,
- hoverable: true,
- valuesVisible: true,
- valuesLabelStyle: 'inside',
- valuesMask: "{category}",
- colors: cores,
- tooltipFormat : function(scene) {
- var cat = this.scene.datum.atoms['category'].value,
- val = this.scene.datum.atoms['value'].value;
- return ""+cat+" " + format( "#.###,", val);
- },
- extensionPoints: {
- slice_strokeStyle: 'white'
- }
- };
- new pvc.PieChart(
- config
- ).setData(dados, {
- crosstabMode : false
- }).render();
- i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
- },
- pontos: function(dados,maior,cores,legendaY,legendaX,tipo){
- config = i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
- var config = {
- canvas : "i3GEOgraficointerativo1guia4objCanvas",
- width : dados.resultset.length * $i("i3GEOgraficointerativo1FatorTamanho").value,
- height : parseInt($i("i3GEOF.graficointerativo1_corpo").style.height,10) - 80,
- animate: true,
- selectable: true,
- hoverable: true,
- valuesVisible: false,
- colors: cores,
- orthoAxisTitle: legendaY,
- valuesFont : 'normal 9px sans-serif ',
- baseAxisTitle: legendaX,
- yAxisTickFormatter: function(valor){
- valor = valor+"";
- valor = format( "#.###,", valor);
- return valor;
- },
- valueFormat: function(valor){
- valor = valor+"";
- valor = format( "#.###,", valor);
- return valor;
- },
- tooltipFormat : function(scene) {
- var cat = this.scene.datum.atoms['category'].value,
- val = this.scene.datum.atoms['value'].value;
- return "X: "+cat+" Y: " + format( "#.###,", val);
- }
+ };
+ if(maior > 0){
+ config.orthoAxisFixedMax = maior;
+ }
+ return config;
+ },
+ barras : function(dados, maior, cores, legendaY, legendaX, xInclinado, tipo) {
+ var ct = true,
+ sr = false,
+ config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
+ legendaY, legendaX);
+ if(cores != ""){
+ config.extensionPoints.bar_fillStyle = function(d) {
+ return cores[this.index];
};
- new pvc.DotChart(
- config
- ).setData(dados, {
- crosstabMode : false
- }).render();
- i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
}
-};
\ No newline at end of file
+ if (tipo === "horizontal") {
+ config.orientation = 'horizontal';
+ }
+ if (xInclinado == true) {
+ config.extensionPoints.xAxisLabel_textAngle = -Math.PI / 3;
+ config.extensionPoints.xAxisLabel_textBaseline = 'top';
+ config.extensionPoints.xAxisLabel_textAlign = 'right';
+ }
+ if(dados.resultset[0].length > 2){
+ config.stacked = $i("i3GEOFgraficointerativo1ativaStacked").checked;
+ config.legend = true;
+ ct = true;
+ sr = $i("i3GEOFgraficointerativo1ativaRowsInColumns").checked;
+ }
+ new pvc.BarChart(config).setData(dados, {
+ crosstabMode : ct,
+ seriesInRows: sr
+ }).render();
+ i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
+ },
+ linhas : function(dados, maior, cores, legendaY, legendaX, xInclinado, tipo) {
+ var ct = false,
+ sr = false,
+ config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
+ legendaY, legendaX);
+ if (xInclinado == true) {
+ config.extensionPoints.xAxisLabel_textAngle = -Math.PI / 3;
+ config.extensionPoints.xAxisLabel_textBaseline = 'top';
+ config.extensionPoints.xAxisLabel_textAlign = 'right';
+ }
+ config.dotsVisible = true;
+
+ if(dados.resultset[0].length > 2){
+ config.stacked = $i("i3GEOFgraficointerativo1ativaStacked").checked;
+ config.legend = true;
+ ct = true;
+ sr = $i("i3GEOFgraficointerativo1ativaRowsInColumns").checked;
+ }
+ new pvc.LineChart(config).setData(dados, {
+ crosstabMode : ct,
+ seriesInRows: sr
+ }).render();
+ i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
+ },
+ areas : function(dados, maior, cores, legendaY, legendaX, xInclinado, tipo) {
+ var ct = false,
+ sr = false,
+ config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
+ legendaY, legendaX);
+ if (xInclinado == true) {
+ config.extensionPoints.xAxisLabel_textAngle = -Math.PI / 3;
+ config.extensionPoints.xAxisLabel_textBaseline = 'top';
+ config.extensionPoints.xAxisLabel_textAlign = 'right';
+ }
+ config.dotsVisible = true;
+ config.areasVisible = true;
+
+ if(dados.resultset[0].length > 2){
+ config.stacked = $i("i3GEOFgraficointerativo1ativaStacked").checked;
+ config.legend = true;
+ ct = true;
+ sr = $i("i3GEOFgraficointerativo1ativaRowsInColumns").checked;
+ }
+ new pvc.LineChart(config).setData(dados, {
+ crosstabMode : ct,
+ seriesInRows: sr
+ }).render();
+ i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
+ },
+ arvores : function(dados, maior, cores, legendaY, legendaX, tipo) {
+ // config =
+ // i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);
+ // config.rootCategoryLabel = legendaX;
+ config = {
+ canvas : "i3GEOgraficointerativo1guia4objCanvas",
+ width : dados.resultset.length
+ * $i("i3GEOgraficointerativo1FatorTamanho").value,
+ height : parseInt(
+ $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
+ title : legendaY,
+ titleFont : 'italic 14px sans-serif',
+ selectable : true,
+ hoverable : true,
+ legend : false,
+ tooltipEnabled : true,
+ legendPosition : 'right',
+ rootCategoryLabel : legendaX,
+ tooltipFormat : function(scene) {
+ var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms.size.value;
+ return "" + cat + " "
+ + format("#.###,", val);
+ }
+ };
+ if(cores != ""){
+ config.colors = cores;
+ }
+ new pvc.TreemapChart(config).setData(dados, {
+ crosstabMode : false
+ }).render();
+ i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
+ },
+ pizzas : function(dados, maior, cores, legendaY, legendaX, tipo) {
+ config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
+ legendaY, legendaX);
+ var config = {
+ canvas : "i3GEOgraficointerativo1guia4objCanvas",
+ width : dados.resultset.length
+ * $i("i3GEOgraficointerativo1FatorTamanho").value,
+ height : parseInt(
+ $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
+ animate : true,
+ selectable : true,
+ hoverable : true,
+ valuesVisible : true,
+ valuesLabelStyle : 'inside',
+ valuesMask : "{category}",
+ tooltipFormat : function(scene) {
+ var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;
+ return "" + cat + " "
+ + format("#.###,", val);
+ },
+ extensionPoints : {
+ slice_strokeStyle : 'white'
+ }
+ };
+ if(cores != ""){
+ config.colors = cores;
+ }
+ new pvc.PieChart(config).setData(dados, {
+ crosstabMode : false
+ }).render();
+ i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
+ },
+ pontos : function(dados, maior, cores, legendaY, legendaX, tipo) {
+ config = i3GEOF.graficointerativo1.configDefault(dados, maior, cores,
+ legendaY, legendaX);
+ var config = {
+ canvas : "i3GEOgraficointerativo1guia4objCanvas",
+ width : dados.resultset.length
+ * $i("i3GEOgraficointerativo1FatorTamanho").value,
+ height : parseInt(
+ $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,
+ animate : true,
+ selectable : true,
+ hoverable : true,
+ valuesVisible : false,
+ orthoAxisTitle : legendaY,
+ valuesFont : 'normal 9px sans-serif ',
+ baseAxisTitle : legendaX,
+ yAxisTickFormatter : function(valor) {
+ valor = valor + "";
+ valor = format("#.###,", valor);
+ return valor;
+ },
+ valueFormat : function(valor) {
+ valor = valor + "";
+ valor = format("#.###,", valor);
+ return valor;
+ },
+ tooltipFormat : function(scene) {
+ var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;
+ return "X: " + cat + " Y: "
+ + format("#.###,", val);
+ }
+ };
+ if(cores != ""){
+ config.colors = cores;
+ }
+ new pvc.DotChart(config).setData(dados, {
+ crosstabMode : false
+ }).render();
+ i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
+ }
+};
diff --git a/ferramentas/metaestat/analise.php b/ferramentas/metaestat/analise.php
index c783828..0afa39d 100644
--- a/ferramentas/metaestat/analise.php
+++ b/ferramentas/metaestat/analise.php
@@ -690,14 +690,14 @@ function juntaMedidasVariaveis($map_file,$layerNames,$nome){
$cwhere[] = "tabela0.".$colunasIdentificador[0]."::text = "."tabela".$i.".".$colunasIdentificador[$i]."::text";
}
$colunasDados = array();
- $itens = array($gid);
- $itensdesc = array("gid");
+ $itens = array($gid,"regiao");
+ $itensdesc = array("gid","Regiao");
for($i=0;$i<$n;$i++){
- $colunasDados[] = "tabela".$i.".".$colunasValor[$i]." as valorTema".$i;
- $itens[] = "valorTema".$i;
+ $colunasDados[] = "tabela".$i.".".$colunasValor[$i]." as valortema".$i;
+ $itens[] = "valortema".$i;
$itensdesc[] = $nomesLayers[$i];
}
- $sqlfinal = "SELECT tabela0.".$gid.",tabela0.".$regiao["colunageo"]." as the_geom,".implode(",",$colunasDados)." from ".implode(",",$sqls)." WHERE ";
+ $sqlfinal = "SELECT tabela0.".$gid.",tabela0.".$regiao["colunanomeregiao"]." as regiao,tabela0.".$regiao["colunageo"]." as the_geom,".implode(",",$colunasDados)." from ".implode(",",$sqls)." WHERE ";
$sqlfinal .= implode($cwhere," AND ");
$sqlfinal = str_replace("/*FA*/","",$sqlfinal);
$sqlfinal = str_replace("/*FAT*/","",$sqlfinal);
@@ -713,7 +713,6 @@ function juntaMedidasVariaveis($map_file,$layerNames,$nome){
$nlayer->setmetadata("nomeoriginal","");
$nlayer->setmetadata("ITENS",implode(",",$itens));
$nlayer->setmetadata("ITENSDESC",implode(",",$itensdesc));
-
$nclass = $nlayer->numclasses;
for($i=1;$i<$nclass;$i++){
$nlayer->getclass($i)->set("status",MS_DELETE);
--
libgit2 0.21.2