Commit 4a5d0a25d6c12f9ee149960dad3f090f67c44993
1 parent
e1232b4e
Exists in
master
and in
7 other branches
Inclusão d eparâmetros de configuração para permitir o uso fora do padrão normal
Showing
1 changed file
with
62 additions
and
4 deletions
Show diff stats
ferramentas/graficointerativo/index.js.php
| @@ -44,6 +44,54 @@ i3GEOF.graficointerativo = { | @@ -44,6 +44,54 @@ i3GEOF.graficointerativo = { | ||
| 44 | */ | 44 | */ |
| 45 | tipo: "", | 45 | tipo: "", |
| 46 | /* | 46 | /* |
| 47 | + Propriedade: acumula | ||
| 48 | + | ||
| 49 | + Acumula os valores ao gerar o gráfico | ||
| 50 | + | ||
| 51 | + Type: | ||
| 52 | + {boolean} | ||
| 53 | + | ||
| 54 | + Default: | ||
| 55 | + {false} | ||
| 56 | + */ | ||
| 57 | + acumula: false, | ||
| 58 | + /* | ||
| 59 | + Propriedade: relativa | ||
| 60 | + | ||
| 61 | + Utiliza valores relativos ao criar o gráfico | ||
| 62 | + | ||
| 63 | + Type: | ||
| 64 | + {boolean} | ||
| 65 | + | ||
| 66 | + Default: | ||
| 67 | + {false} | ||
| 68 | + */ | ||
| 69 | + relativa: false, | ||
| 70 | + /* | ||
| 71 | + Propriedade: dadospuros | ||
| 72 | + | ||
| 73 | + Não faz nenhum tipo de processamento nos dados antes de gerar o gráfico | ||
| 74 | + | ||
| 75 | + Type: | ||
| 76 | + {boolean} | ||
| 77 | + | ||
| 78 | + Default: | ||
| 79 | + {false} | ||
| 80 | + */ | ||
| 81 | + dadospuros: false, | ||
| 82 | + /* | ||
| 83 | + Propriedade: navegacao | ||
| 84 | + | ||
| 85 | + Ativa ou não a navegação dinâmica do mapa | ||
| 86 | + | ||
| 87 | + Type: | ||
| 88 | + {boolean} | ||
| 89 | + | ||
| 90 | + Default: | ||
| 91 | + {false} | ||
| 92 | + */ | ||
| 93 | + navegacao:false, | ||
| 94 | + /* | ||
| 47 | Function: inicia | 95 | Function: inicia |
| 48 | 96 | ||
| 49 | Inicia a ferramenta. É chamado por criaJanelaFlutuante | 97 | Inicia a ferramenta. É chamado por criaJanelaFlutuante |
| @@ -57,6 +105,11 @@ i3GEOF.graficointerativo = { | @@ -57,6 +105,11 @@ i3GEOF.graficointerativo = { | ||
| 57 | inicia: function(iddiv,dados){ | 105 | inicia: function(iddiv,dados){ |
| 58 | try{ | 106 | try{ |
| 59 | $i(iddiv).innerHTML += i3GEOF.graficointerativo.html(); | 107 | $i(iddiv).innerHTML += i3GEOF.graficointerativo.html(); |
| 108 | + $i("i3GEOgraficointerativoAcumula").checked = i3GEOF.graficointerativo.acumula; | ||
| 109 | + $i("i3GEOgraficointerativoRelativa").checked = i3GEOF.graficointerativo.relativa; | ||
| 110 | + $i("i3GEOgraficointerativoDadosPuros").checked = i3GEOF.graficointerativo.dadospuros; | ||
| 111 | + if(i3GEOF.graficointerativo.navegacao == true) | ||
| 112 | + {i3GEOF.graficointerativo.ativaNavegacao(true);} | ||
| 60 | i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativoguia1","i3GEOgraficointerativoguia"); | 113 | i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativoguia1","i3GEOgraficointerativoguia"); |
| 61 | //eventos das guias | 114 | //eventos das guias |
| 62 | $i("i3GEOgraficointerativoguia1").onclick = function(){ | 115 | $i("i3GEOgraficointerativoguia1").onclick = function(){ |
| @@ -187,7 +240,7 @@ i3GEOF.graficointerativo = { | @@ -187,7 +240,7 @@ i3GEOF.graficointerativo = { | ||
| 187 | ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoAcumula /> Utiliza valores acumulados</p>' + | 240 | ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoAcumula /> Utiliza valores acumulados</p>' + |
| 188 | ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoRelativa /> Utiliza valores relativos (%)</p>' + | 241 | ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoRelativa /> Utiliza valores relativos (%)</p>' + |
| 189 | ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoDadosPuros /> Não processa os valores ao obter os dados (mantém os dados como estão na tabela de atributos) - essa opção é útil nos gráficos de distribuição de pontos</p>' + | 242 | ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativoDadosPuros /> Não processa os valores ao obter os dados (mantém os dados como estão na tabela de atributos) - essa opção é útil nos gráficos de distribuição de pontos</p>' + |
| 190 | - ' <p class=paragrafo ><input style=cursor:pointer type=checkbox onclick="i3GEOF.graficointerativo.ativaNavegacao(this)" /> Atualiza o gráfico ao navegar pelo mapa</p>' + | 243 | + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox onclick="i3GEOF.graficointerativo.ativaNavegacao(this.checked)" /> Atualiza o gráfico ao navegar pelo mapa</p>' + |
| 191 | '</div>'+ | 244 | '</div>'+ |
| 192 | '<div class=guiaobj id="i3GEOgraficointerativoguia4obj" style="left:1px;display:none;top:-5px">' + | 245 | '<div class=guiaobj id="i3GEOgraficointerativoguia4obj" style="left:1px;display:none;top:-5px">' + |
| 193 | ' <div id="i3GEOgraficointerativoGrafico"></div>' + | 246 | ' <div id="i3GEOgraficointerativoGrafico"></div>' + |
| @@ -364,13 +417,18 @@ i3GEOF.graficointerativo = { | @@ -364,13 +417,18 @@ i3GEOF.graficointerativo = { | ||
| 364 | retorno {JSON} - dados no formato JSON | 417 | retorno {JSON} - dados no formato JSON |
| 365 | */ | 418 | */ |
| 366 | montaTabelaDados: function(retorno){ | 419 | montaTabelaDados: function(retorno){ |
| 367 | - var dados = retorno.data.dados, | ||
| 368 | - n = dados.length, | 420 | + var dados, |
| 421 | + n, | ||
| 369 | v, | 422 | v, |
| 370 | ins = [], | 423 | ins = [], |
| 371 | i, | 424 | i, |
| 372 | id, | 425 | id, |
| 373 | cor = "#d01f3c"; | 426 | cor = "#d01f3c"; |
| 427 | + if(retorno.dados) | ||
| 428 | + {dados = retorno.data.dados;} | ||
| 429 | + else | ||
| 430 | + {dados = retorno;} | ||
| 431 | + n = dados.length; | ||
| 374 | ins.push("<p class=paragrafo >Tabela de dados para o gráfico. Os valores podem ser editados</p><table class=lista4 id=i3GEOgraficointerativotabeladados ><tr><td></td>"); | 432 | ins.push("<p class=paragrafo >Tabela de dados para o gráfico. Os valores podem ser editados</p><table class=lista4 id=i3GEOgraficointerativotabeladados ><tr><td></td>"); |
| 375 | ins.push("<td style=background-color:yellow > <img style=cursor:pointer onclick='i3GEOF.graficointerativo.ordenaColuna(this,1)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> nome</td>"); | 433 | ins.push("<td style=background-color:yellow > <img style=cursor:pointer onclick='i3GEOF.graficointerativo.ordenaColuna(this,1)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> nome</td>"); |
| 376 | ins.push("<td style=background-color:yellow > <img style=cursor:pointer onclick='i3GEOF.graficointerativo.ordenaColuna(this,2)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> valor</td>"); | 434 | ins.push("<td style=background-color:yellow > <img style=cursor:pointer onclick='i3GEOF.graficointerativo.ordenaColuna(this,2)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> valor</td>"); |
| @@ -700,7 +758,7 @@ i3GEOF.graficointerativo = { | @@ -700,7 +758,7 @@ i3GEOF.graficointerativo = { | ||
| 700 | Ativa ou desativa a atualização automática ao navegar no mapa | 758 | Ativa ou desativa a atualização automática ao navegar no mapa |
| 701 | */ | 759 | */ |
| 702 | ativaNavegacao: function(obj){ | 760 | ativaNavegacao: function(obj){ |
| 703 | - if(obj.checked){ | 761 | + if(obj == true){ |
| 704 | if(i3GEO.Interface.ATUAL === "padrao"){ | 762 | if(i3GEO.Interface.ATUAL === "padrao"){ |
| 705 | i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo.obterDados()"); | 763 | i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo.obterDados()"); |
| 706 | } | 764 | } |