Commit a91620426aafff51ffd9856bcce471186bc33dbb

Authored by Edmar Moretti
1 parent e06252b8

$1

Showing 1 changed file with 54 additions and 62 deletions   Show diff stats
ferramentas/graficointerativo1/index.js
@@ -170,11 +170,14 @@ i3GEOF.graficointerativo1 = { @@ -170,11 +170,14 @@ i3GEOF.graficointerativo1 = {
170 i3GEOF.graficointerativo1.ativaNavegacao(true); 170 i3GEOF.graficointerativo1.ativaNavegacao(true);
171 } 171 }
172 // eventos das guias 172 // eventos das guias
  173 +
  174 + //tipos de graficos
173 $i("i3GEOgraficointerativo1guia1").onclick = function() { 175 $i("i3GEOgraficointerativo1guia1").onclick = function() {
174 i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1", 176 i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
175 "i3GEOgraficointerativo1guia"); 177 "i3GEOgraficointerativo1guia");
176 $i("i3GEOgraficointerativo1Grafico").style.display = "none"; 178 $i("i3GEOgraficointerativo1Grafico").style.display = "none";
177 }; 179 };
  180 + //dados para o grafico
178 $i("i3GEOgraficointerativo1guia2").onclick = function() { 181 $i("i3GEOgraficointerativo1guia2").onclick = function() {
179 if(i3GEOF.graficointerativo1.tipo === ""){ 182 if(i3GEOF.graficointerativo1.tipo === ""){
180 alert($trad(4, i3GEOF.graficointerativo1.dicionario)); 183 alert($trad(4, i3GEOF.graficointerativo1.dicionario));
@@ -184,11 +187,13 @@ i3GEOF.graficointerativo1 = { @@ -184,11 +187,13 @@ i3GEOF.graficointerativo1 = {
184 i3GEOF.graficointerativo1.configuraDados(); 187 i3GEOF.graficointerativo1.configuraDados();
185 $i("i3GEOgraficointerativo1Grafico").style.display = "none"; 188 $i("i3GEOgraficointerativo1Grafico").style.display = "none";
186 }; 189 };
  190 + //propriedades adicionais
187 $i("i3GEOgraficointerativo1guia3").onclick = function() { 191 $i("i3GEOgraficointerativo1guia3").onclick = function() {
188 i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3", 192 i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3",
189 "i3GEOgraficointerativo1guia"); 193 "i3GEOgraficointerativo1guia");
190 $i("i3GEOgraficointerativo1Grafico").style.display = "none"; 194 $i("i3GEOgraficointerativo1Grafico").style.display = "none";
191 }; 195 };
  196 + //mostra o grafico
192 $i("i3GEOgraficointerativo1guia4").onclick = function() { 197 $i("i3GEOgraficointerativo1guia4").onclick = function() {
193 if(i3GEOF.graficointerativo1.tipo === ""){ 198 if(i3GEOF.graficointerativo1.tipo === ""){
194 alert($trad(4, i3GEOF.graficointerativo1.dicionario)); 199 alert($trad(4, i3GEOF.graficointerativo1.dicionario));
@@ -228,15 +233,15 @@ i3GEOF.graficointerativo1 = { @@ -228,15 +233,15 @@ i3GEOF.graficointerativo1 = {
228 return; 233 return;
229 } 234 }
230 var w,h,form = $i("i3GEOgraficointerativo1PNG"), 235 var w,h,form = $i("i3GEOgraficointerativo1PNG"),
231 - isvg = form.getElementsByTagName("input")[0],  
232 - svg = $i("i3GEOgraficointerativo1guia4objCanvas").firstChild; 236 + isvg = form.getElementsByTagName("input")[0],
  237 + svg = $i("i3GEOgraficointerativo1guia4objCanvas").firstChild;
233 h = svg.getAttributeNS(null, 'height'); 238 h = svg.getAttributeNS(null, 'height');
234 w = svg.getAttributeNS(null, 'width'); 239 w = svg.getAttributeNS(null, 'width');
235 - if (typeof XMLSerializer != "undefined"){  
236 - svg = (new XMLSerializer()).serializeToString(svg);  
237 - } else {  
238 - svg = svg.html();  
239 - } 240 + if (typeof XMLSerializer != "undefined"){
  241 + svg = (new XMLSerializer()).serializeToString(svg);
  242 + } else {
  243 + svg = svg.html();
  244 + }
240 isvg.value = svg; 245 isvg.value = svg;
241 form.action = form.action+"?"+"w="+w+"&h="+h; 246 form.action = form.action+"?"+"w="+w+"&h="+h;
242 form.submit(); 247 form.submit();
@@ -587,9 +592,10 @@ i3GEOF.graficointerativo1 = { @@ -587,9 +592,10 @@ i3GEOF.graficointerativo1 = {
587 if(i3GEOF.graficointerativo1.tipo == "ponto_1"){ 592 if(i3GEOF.graficointerativo1.tipo == "ponto_1"){
588 $i("i3GEOgraficointerativo1DadosPuros").checked = true; 593 $i("i3GEOgraficointerativo1DadosPuros").checked = true;
589 } 594 }
590 -  
591 - if ($i("i3GEOgraficointerativo1Grafico").innerHTML === ""  
592 - || $i("i3GEOgraficointerativo1tabeladados").innerHTML == "") { 595 + else{
  596 + $i("i3GEOgraficointerativo1DadosPuros").checked = false;
  597 + }
  598 + if (!$i("i3GEOgraficointerativo1tabeladados") || $i("i3GEOgraficointerativo1tabeladados").innerHTML == "") {
593 $i("i3GEOgraficointerativo1guia2").onclick.call(); 599 $i("i3GEOgraficointerativo1guia2").onclick.call();
594 } else { 600 } else {
595 $i("i3GEOgraficointerativo1guia4").onclick.call(); 601 $i("i3GEOgraficointerativo1guia4").onclick.call();
@@ -597,8 +603,8 @@ i3GEOF.graficointerativo1 = { @@ -597,8 +603,8 @@ i3GEOF.graficointerativo1 = {
597 }, 603 },
598 alteraFatorPixel: function(tipo){ 604 alteraFatorPixel: function(tipo){
599 var delta = 20, 605 var delta = 20,
600 - temp = $i("i3GEOgraficointerativo1FatorTamanho"),  
601 - v = parseInt(temp.value,10); 606 + temp = $i("i3GEOgraficointerativo1FatorTamanho"),
  607 + v = parseInt(temp.value,10);
602 if(temp.value >= 0){ 608 if(temp.value >= 0){
603 if(tipo === "mais"){ 609 if(tipo === "mais"){
604 temp.value = v + delta; 610 temp.value = v + delta;
@@ -649,7 +655,7 @@ i3GEOF.graficointerativo1 = { @@ -649,7 +655,7 @@ i3GEOF.graficointerativo1 = {
649 */ 655 */
650 comboItensSel : function() { 656 comboItensSel : function() {
651 var adicionaFilho = function(){}, 657 var adicionaFilho = function(){},
652 - tema = $i("i3GEOgraficointerativo1ComboTemasId").value; 658 + tema = $i("i3GEOgraficointerativo1ComboTemasId").value;
653 i3GEO.util 659 i3GEO.util
654 .comboItens( 660 .comboItens(
655 "i3GEOgraficointerativo1ComboXid", 661 "i3GEOgraficointerativo1ComboXid",
@@ -688,20 +694,20 @@ i3GEOF.graficointerativo1 = { @@ -688,20 +694,20 @@ i3GEOF.graficointerativo1 = {
688 694
689 adicionaFilho = function() { 695 adicionaFilho = function() {
690 var no = document.createElement("div"), 696 var no = document.createElement("div"),
691 - id = "CorG"+parseInt(Math.random()*100000,10),  
692 - novoselect; 697 + id = "CorG"+parseInt(Math.random()*100000,10),
  698 + novoselect;
693 no.innerHTML = retorno.dados 699 no.innerHTML = retorno.dados
694 - + "&nbsp;<input title='"  
695 - + $trad(33, i3GEOF.graficointerativo1.dicionario)  
696 - + "' class=digitar type=text size=20 value='' />"  
697 - + "&nbsp;<input id='"  
698 - + id  
699 - + "' class=digitar type=text size=8 value='' />"  
700 - + "<img alt='aquarela.gif' style=position:relative;top:3px;left:3px;cursor:pointer src='"  
701 - + i3GEO.configura.locaplic  
702 - + "/imagens/aquarela.gif' onclick='i3GEOF.graficointerativo1.corj(\""  
703 - + id  
704 - + "\")' /><br>"; 700 + + "&nbsp;<input title='"
  701 + + $trad(33, i3GEOF.graficointerativo1.dicionario)
  702 + + "' class=digitar type=text size=20 value='' />"
  703 + + "&nbsp;<input id='"
  704 + + id
  705 + + "' class=digitar type=text size=8 value='' />"
  706 + + "<img alt='aquarela.gif' style=position:relative;top:3px;left:3px;cursor:pointer src='"
  707 + + i3GEO.configura.locaplic
  708 + + "/imagens/aquarela.gif' onclick='i3GEOF.graficointerativo1.corj(\""
  709 + + id
  710 + + "\")' /><br>";
705 novoselect = no.getElementsByTagName("select")[0]; 711 novoselect = no.getElementsByTagName("select")[0];
706 novoselect.id = ""; 712 novoselect.id = "";
707 novoselect.onchange = adicionaFilho; 713 novoselect.onchange = adicionaFilho;
@@ -752,7 +758,7 @@ i3GEOF.graficointerativo1 = { @@ -752,7 +758,7 @@ i3GEOF.graficointerativo1 = {
752 + i3GEO.configura.sid + "&funcao=graficoSelecao&tema=" + tema 758 + i3GEO.configura.sid + "&funcao=graficoSelecao&tema=" + tema
753 + "&itemclasses=" + x + "&itemvalores=" + y + "&exclui=" 759 + "&itemclasses=" + x + "&itemvalores=" + y + "&exclui="
754 + excluir + "&ext=" + i3GEO.parametros.mapexten; 760 + excluir + "&ext=" + i3GEO.parametros.mapexten;
755 - 761 +
756 if ($i("i3GEOgraficointerativo1DadosPuros").checked) { 762 if ($i("i3GEOgraficointerativo1DadosPuros").checked) {
757 tipo = "nenhum"; 763 tipo = "nenhum";
758 } else { 764 } else {
@@ -921,12 +927,12 @@ i3GEOF.graficointerativo1 = { @@ -921,12 +927,12 @@ i3GEOF.graficointerativo1 = {
921 */ 927 */
922 tabela2csv : function() { 928 tabela2csv : function() {
923 var colunas = i3GEOF.graficointerativo1.nomesColunas(), 929 var colunas = i3GEOF.graficointerativo1.nomesColunas(),
924 - ncolunas = colunas[0].length,  
925 - inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"),  
926 - ninputs = inputs.length,  
927 - i,j,  
928 - temp,  
929 - csv = []; 930 + ncolunas = colunas[0].length,
  931 + inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"),
  932 + ninputs = inputs.length,
  933 + i,j,
  934 + temp,
  935 + csv = [];
930 936
931 csv.push(colunas[0].join(";")); 937 csv.push(colunas[0].join(";"));
932 for (i = 0; i < ninputs; i = (i + 1 + ncolunas)){ 938 for (i = 0; i < ninputs; i = (i + 1 + ncolunas)){
@@ -1340,15 +1346,9 @@ i3GEOF.graficointerativo1 = { @@ -1340,15 +1346,9 @@ i3GEOF.graficointerativo1 = {
1340 i3GEOF.graficointerativo1.aguarde.visibility = "hidden"; 1346 i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
1341 }, 1347 },
1342 arvores : function(dados, maior, cores, legendaY, legendaX, tipo) { 1348 arvores : function(dados, maior, cores, legendaY, legendaX, tipo) {
1343 - // config =  
1344 - // i3GEOF.graficointerativo1.configDefault(dados,maior,cores,legendaY,legendaX);  
1345 - // config.rootCategoryLabel = legendaX; 1349 +
1346 config = { 1350 config = {
1347 canvas : "i3GEOgraficointerativo1guia4objCanvas", 1351 canvas : "i3GEOgraficointerativo1guia4objCanvas",
1348 - width : dados.resultset.length  
1349 - * $i("i3GEOgraficointerativo1FatorTamanho").value,  
1350 - height : parseInt(  
1351 - $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,  
1352 title : legendaY, 1352 title : legendaY,
1353 titleFont : 'italic 14px sans-serif', 1353 titleFont : 'italic 14px sans-serif',
1354 selectable : true, 1354 selectable : true,
@@ -1376,24 +1376,20 @@ i3GEOF.graficointerativo1 = { @@ -1376,24 +1376,20 @@ i3GEOF.graficointerativo1 = {
1376 legendaY, legendaX); 1376 legendaY, legendaX);
1377 var config = { 1377 var config = {
1378 canvas : "i3GEOgraficointerativo1guia4objCanvas", 1378 canvas : "i3GEOgraficointerativo1guia4objCanvas",
1379 - width : dados.resultset.length  
1380 - * $i("i3GEOgraficointerativo1FatorTamanho").value,  
1381 - height : parseInt(  
1382 - $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,  
1383 - animate : true,  
1384 - selectable : true,  
1385 - hoverable : true,  
1386 - valuesVisible : true,  
1387 - valuesLabelStyle : 'inside',  
1388 - valuesMask : "{category}",  
1389 - tooltipFormat : function(scene) {  
1390 - var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;  
1391 - return "<span style=color:yellow >" + cat + "</span><br>"  
1392 - + format("#.###,", val);  
1393 - },  
1394 - extensionPoints : {  
1395 - slice_strokeStyle : 'white'  
1396 - } 1379 + animate : true,
  1380 + selectable : true,
  1381 + hoverable : true,
  1382 + valuesVisible : true,
  1383 + valuesLabelStyle : 'inside',
  1384 + valuesMask : "{category}",
  1385 + tooltipFormat : function(scene) {
  1386 + var cat = this.scene.datum.atoms['category'].value, val = this.scene.datum.atoms['value'].value;
  1387 + return "<span style=color:yellow >" + cat + "</span><br>"
  1388 + + format("#.###,", val);
  1389 + },
  1390 + extensionPoints : {
  1391 + slice_strokeStyle : 'white'
  1392 + }
1397 }; 1393 };
1398 if(cores != ""){ 1394 if(cores != ""){
1399 config.colors = cores; 1395 config.colors = cores;
@@ -1408,10 +1404,6 @@ i3GEOF.graficointerativo1 = { @@ -1408,10 +1404,6 @@ i3GEOF.graficointerativo1 = {
1408 legendaY, legendaX); 1404 legendaY, legendaX);
1409 var config = { 1405 var config = {
1410 canvas : "i3GEOgraficointerativo1guia4objCanvas", 1406 canvas : "i3GEOgraficointerativo1guia4objCanvas",
1411 - width : dados.resultset.length  
1412 - * $i("i3GEOgraficointerativo1FatorTamanho").value,  
1413 - height : parseInt(  
1414 - $i("i3GEOF.graficointerativo1_corpo").style.height, 10) - 80,  
1415 animate : true, 1407 animate : true,
1416 selectable : true, 1408 selectable : true,
1417 hoverable : true, 1409 hoverable : true,