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 170 i3GEOF.graficointerativo1.ativaNavegacao(true);
171 171 }
172 172 // eventos das guias
  173 +
  174 + //tipos de graficos
173 175 $i("i3GEOgraficointerativo1guia1").onclick = function() {
174 176 i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1",
175 177 "i3GEOgraficointerativo1guia");
176 178 $i("i3GEOgraficointerativo1Grafico").style.display = "none";
177 179 };
  180 + //dados para o grafico
178 181 $i("i3GEOgraficointerativo1guia2").onclick = function() {
179 182 if(i3GEOF.graficointerativo1.tipo === ""){
180 183 alert($trad(4, i3GEOF.graficointerativo1.dicionario));
... ... @@ -184,11 +187,13 @@ i3GEOF.graficointerativo1 = {
184 187 i3GEOF.graficointerativo1.configuraDados();
185 188 $i("i3GEOgraficointerativo1Grafico").style.display = "none";
186 189 };
  190 + //propriedades adicionais
187 191 $i("i3GEOgraficointerativo1guia3").onclick = function() {
188 192 i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3",
189 193 "i3GEOgraficointerativo1guia");
190 194 $i("i3GEOgraficointerativo1Grafico").style.display = "none";
191 195 };
  196 + //mostra o grafico
192 197 $i("i3GEOgraficointerativo1guia4").onclick = function() {
193 198 if(i3GEOF.graficointerativo1.tipo === ""){
194 199 alert($trad(4, i3GEOF.graficointerativo1.dicionario));
... ... @@ -228,15 +233,15 @@ i3GEOF.graficointerativo1 = {
228 233 return;
229 234 }
230 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 238 h = svg.getAttributeNS(null, 'height');
234 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 245 isvg.value = svg;
241 246 form.action = form.action+"?"+"w="+w+"&h="+h;
242 247 form.submit();
... ... @@ -587,9 +592,10 @@ i3GEOF.graficointerativo1 = {
587 592 if(i3GEOF.graficointerativo1.tipo == "ponto_1"){
588 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 599 $i("i3GEOgraficointerativo1guia2").onclick.call();
594 600 } else {
595 601 $i("i3GEOgraficointerativo1guia4").onclick.call();
... ... @@ -597,8 +603,8 @@ i3GEOF.graficointerativo1 = {
597 603 },
598 604 alteraFatorPixel: function(tipo){
599 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 608 if(temp.value >= 0){
603 609 if(tipo === "mais"){
604 610 temp.value = v + delta;
... ... @@ -649,7 +655,7 @@ i3GEOF.graficointerativo1 = {
649 655 */
650 656 comboItensSel : function() {
651 657 var adicionaFilho = function(){},
652   - tema = $i("i3GEOgraficointerativo1ComboTemasId").value;
  658 + tema = $i("i3GEOgraficointerativo1ComboTemasId").value;
653 659 i3GEO.util
654 660 .comboItens(
655 661 "i3GEOgraficointerativo1ComboXid",
... ... @@ -688,20 +694,20 @@ i3GEOF.graficointerativo1 = {
688 694  
689 695 adicionaFilho = function() {
690 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 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 711 novoselect = no.getElementsByTagName("select")[0];
706 712 novoselect.id = "";
707 713 novoselect.onchange = adicionaFilho;
... ... @@ -752,7 +758,7 @@ i3GEOF.graficointerativo1 = {
752 758 + i3GEO.configura.sid + "&funcao=graficoSelecao&tema=" + tema
753 759 + "&itemclasses=" + x + "&itemvalores=" + y + "&exclui="
754 760 + excluir + "&ext=" + i3GEO.parametros.mapexten;
755   -
  761 +
756 762 if ($i("i3GEOgraficointerativo1DadosPuros").checked) {
757 763 tipo = "nenhum";
758 764 } else {
... ... @@ -921,12 +927,12 @@ i3GEOF.graficointerativo1 = {
921 927 */
922 928 tabela2csv : function() {
923 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 937 csv.push(colunas[0].join(";"));
932 938 for (i = 0; i < ninputs; i = (i + 1 + ncolunas)){
... ... @@ -1340,15 +1346,9 @@ i3GEOF.graficointerativo1 = {
1340 1346 i3GEOF.graficointerativo1.aguarde.visibility = "hidden";
1341 1347 },
1342 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 1350 config = {
1347 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 1352 title : legendaY,
1353 1353 titleFont : 'italic 14px sans-serif',
1354 1354 selectable : true,
... ... @@ -1376,24 +1376,20 @@ i3GEOF.graficointerativo1 = {
1376 1376 legendaY, legendaX);
1377 1377 var config = {
1378 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 1394 if(cores != ""){
1399 1395 config.colors = cores;
... ... @@ -1408,10 +1404,6 @@ i3GEOF.graficointerativo1 = {
1408 1404 legendaY, legendaX);
1409 1405 var config = {
1410 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 1407 animate : true,
1416 1408 selectable : true,
1417 1409 hoverable : true,
... ...