Commit b9ae2ef307f2a5b35e98d8817eedd03f6b972c67
1 parent
10485b52
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
42 additions
and
41 deletions
Show diff stats
ferramentas/graficointerativo1/index.js
@@ -65,6 +65,7 @@ i3GEOF.graficointerativo1 = | @@ -65,6 +65,7 @@ i3GEOF.graficointerativo1 = | ||
65 | dicionario["idjanelaA"] = '"'+idjanela+'"'; | 65 | dicionario["idjanelaA"] = '"'+idjanela+'"'; |
66 | dicionario["locaplic"] = i3GEO.configura.locaplic; | 66 | dicionario["locaplic"] = i3GEO.configura.locaplic; |
67 | dicionario["prop"] = $trad('p13'); | 67 | dicionario["prop"] = $trad('p13'); |
68 | + dicionario["asp"] = '"'; | ||
68 | return dicionario; | 69 | return dicionario; |
69 | }, | 70 | }, |
70 | /** | 71 | /** |
@@ -737,7 +738,9 @@ i3GEOF.graficointerativo1 = | @@ -737,7 +738,9 @@ i3GEOF.graficointerativo1 = | ||
737 | } | 738 | } |
738 | }, | 739 | }, |
739 | alteraFatorPixel : function(tipo, idjanela) { | 740 | alteraFatorPixel : function(tipo, idjanela) { |
740 | - var delta = 20, temp = $i(idjanela + "i3GEOgraficointerativo1FatorTamanho"), v = parseInt(temp.value, 10); | 741 | + var delta = 20, |
742 | + temp = $i(idjanela + "i3GEOgraficointerativo1FatorTamanho"), | ||
743 | + v = parseInt(temp.value, 10); | ||
741 | if (temp.value >= 0) { | 744 | if (temp.value >= 0) { |
742 | if (tipo === "mais") { | 745 | if (tipo === "mais") { |
743 | temp.value = v + delta; | 746 | temp.value = v + delta; |
@@ -750,10 +753,10 @@ i3GEOF.graficointerativo1 = | @@ -750,10 +753,10 @@ i3GEOF.graficointerativo1 = | ||
750 | } | 753 | } |
751 | $i(idjanela + "i3GEOgraficointerativo1guia4").onclick.call(); | 754 | $i(idjanela + "i3GEOgraficointerativo1guia4").onclick.call(); |
752 | }, | 755 | }, |
753 | - alteraFatorPixelMenos : function(tipo, idjanela) { | 756 | + alteraFatorPixelMenos : function(idjanela) { |
754 | i3GEOF.graficointerativo1.alteraFatorPixel("menos", idjanela); | 757 | i3GEOF.graficointerativo1.alteraFatorPixel("menos", idjanela); |
755 | }, | 758 | }, |
756 | - alteraFatorPixelMais : function(tipo, idjanela) { | 759 | + alteraFatorPixelMais : function(idjanela) { |
757 | i3GEOF.graficointerativo1.alteraFatorPixel("mais", idjanela); | 760 | i3GEOF.graficointerativo1.alteraFatorPixel("mais", idjanela); |
758 | }, | 761 | }, |
759 | /** | 762 | /** |
@@ -1107,16 +1110,15 @@ i3GEOF.graficointerativo1 = | @@ -1107,16 +1110,15 @@ i3GEOF.graficointerativo1 = | ||
1107 | } | 1110 | } |
1108 | i3GEOF.graficointerativo1.propJanelas[idjanela].aguarde.visibility = "visible"; | 1111 | i3GEOF.graficointerativo1.propJanelas[idjanela].aguarde.visibility = "visible"; |
1109 | 1112 | ||
1110 | - var titulo = "", | ||
1111 | - menor = 0, | ||
1112 | - legendaX = "", | ||
1113 | - legendaY = "", | ||
1114 | - dados = {}, | 1113 | + var legendaX = "", |
1114 | + legendaY = "", | ||
1115 | + dados = {}, | ||
1115 | xInclinado = false; | 1116 | xInclinado = false; |
1116 | - | ||
1117 | - var dados = i3GEOF.graficointerativo1.tabela2dados(idjanela); | 1117 | + |
1118 | + dados = i3GEOF.graficointerativo1.tabela2dados(idjanela); | ||
1118 | 1119 | ||
1119 | xInclinado = $i(idjanela + "i3GEOgraficointerativo1xInclinado").checked; | 1120 | xInclinado = $i(idjanela + "i3GEOgraficointerativo1xInclinado").checked; |
1121 | + /* | ||
1120 | if ($i(idjanela + "i3GEOgraficointerativo1ComboTemasId")) { | 1122 | if ($i(idjanela + "i3GEOgraficointerativo1ComboTemasId")) { |
1121 | titulo = | 1123 | titulo = |
1122 | $i(idjanela + "i3GEOgraficointerativo1ComboTemasId").options[$i(idjanela + "i3GEOgraficointerativo1ComboTemasId").options.selectedIndex].text; | 1124 | $i(idjanela + "i3GEOgraficointerativo1ComboTemasId").options[$i(idjanela + "i3GEOgraficointerativo1ComboTemasId").options.selectedIndex].text; |
@@ -1124,6 +1126,7 @@ i3GEOF.graficointerativo1 = | @@ -1124,6 +1126,7 @@ i3GEOF.graficointerativo1 = | ||
1124 | if (i3GEOF.graficointerativo1.titulo != "") { | 1126 | if (i3GEOF.graficointerativo1.titulo != "") { |
1125 | titulo = i3GEOF.graficointerativo1.titulo; | 1127 | titulo = i3GEOF.graficointerativo1.titulo; |
1126 | } | 1128 | } |
1129 | + */ | ||
1127 | if ($i(idjanela + "i3GEOgraficointerativo1ComboXid")) { | 1130 | if ($i(idjanela + "i3GEOgraficointerativo1ComboXid")) { |
1128 | legendaX = $i(idjanela + "i3GEOgraficointerativo1ComboXidTitulo").value; | 1131 | legendaX = $i(idjanela + "i3GEOgraficointerativo1ComboXidTitulo").value; |
1129 | } | 1132 | } |
@@ -1132,7 +1135,6 @@ i3GEOF.graficointerativo1 = | @@ -1132,7 +1135,6 @@ i3GEOF.graficointerativo1 = | ||
1132 | } | 1135 | } |
1133 | 1136 | ||
1134 | if (legendaX == legendaY && (legendaX != "" && legendaY != "")) { | 1137 | if (legendaX == legendaY && (legendaX != "" && legendaY != "")) { |
1135 | - menor = 0; | ||
1136 | legendaX += " (" + $trad('casos', i3GEOF.graficointerativo1.dicionario) + ")"; | 1138 | legendaX += " (" + $trad('casos', i3GEOF.graficointerativo1.dicionario) + ")"; |
1137 | legendaY += " (" + $trad('numeroCasos', i3GEOF.graficointerativo1.dicionario) + ")"; | 1139 | legendaY += " (" + $trad('numeroCasos', i3GEOF.graficointerativo1.dicionario) + ")"; |
1138 | } | 1140 | } |
@@ -1178,19 +1180,19 @@ i3GEOF.graficointerativo1 = | @@ -1178,19 +1180,19 @@ i3GEOF.graficointerativo1 = | ||
1178 | ncolunas = colunas[0].length, | 1180 | ncolunas = colunas[0].length, |
1179 | temp = 0, | 1181 | temp = 0, |
1180 | ultimo = 0, | 1182 | ultimo = 0, |
1181 | - inputs = $i(idjanela + "i3GEOgraficointerativo1Dados").getElementsByTagName("input"), | ||
1182 | - ninputs = inputs.length, | ||
1183 | - tipoColuna = "String", | ||
1184 | - metadados = [], | ||
1185 | - i, | ||
1186 | - j, | ||
1187 | - acumulado = [], | ||
1188 | - acum, | ||
1189 | - cores = [], | ||
1190 | - par = [], | ||
1191 | - total = 0, | ||
1192 | - menor = 0, | ||
1193 | - maior = 0, | 1183 | + inputs = $i(idjanela + "i3GEOgraficointerativo1Dados").getElementsByTagName("input"), |
1184 | + ninputs = inputs.length, | ||
1185 | + tipoColuna = "String", | ||
1186 | + metadados = [], | ||
1187 | + i, | ||
1188 | + j, | ||
1189 | + acumulado = [], | ||
1190 | + acum, | ||
1191 | + cores = [], | ||
1192 | + par = [], | ||
1193 | + total = 0, | ||
1194 | + menor = 0, | ||
1195 | + maior = 0, | ||
1194 | dados = {}; | 1196 | dados = {}; |
1195 | if (ninputs > 0) { | 1197 | if (ninputs > 0) { |
1196 | menor = inputs[1].value * 1; | 1198 | menor = inputs[1].value * 1; |
@@ -1394,7 +1396,7 @@ i3GEOF.graficointerativo1 = | @@ -1394,7 +1396,7 @@ i3GEOF.graficointerativo1 = | ||
1394 | return config; | 1396 | return config; |
1395 | }, | 1397 | }, |
1396 | barras : function(idjanela, dados, maior, cores, legendaY, legendaX, xInclinado, tipo) { | 1398 | barras : function(idjanela, dados, maior, cores, legendaY, legendaX, xInclinado, tipo) { |
1397 | - var contador = 0, ct = true, sr = false, config = i3GEOF.graficointerativo1.configDefault(idjanela, dados, maior, cores, legendaY, legendaX); | 1399 | + var ct = true, sr = false, config = i3GEOF.graficointerativo1.configDefault(idjanela, dados, maior, cores, legendaY, legendaX); |
1398 | if (tipo === "horizontal") { | 1400 | if (tipo === "horizontal") { |
1399 | config.orientation = 'horizontal'; | 1401 | config.orientation = 'horizontal'; |
1400 | } | 1402 | } |
@@ -1409,7 +1411,7 @@ i3GEOF.graficointerativo1 = | @@ -1409,7 +1411,7 @@ i3GEOF.graficointerativo1 = | ||
1409 | // | 1411 | // |
1410 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); | 1412 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1411 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); | 1413 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1412 | - | 1414 | + |
1413 | if (dados.resultset && dados.resultset[0] && dados.resultset[0].length > 2) { | 1415 | if (dados.resultset && dados.resultset[0] && dados.resultset[0].length > 2) { |
1414 | config.stacked = $i(idjanela + "i3GEOFgraficointerativo1ativaStacked").checked; | 1416 | config.stacked = $i(idjanela + "i3GEOFgraficointerativo1ativaStacked").checked; |
1415 | config.legend = true; | 1417 | config.legend = true; |
@@ -1484,7 +1486,7 @@ i3GEOF.graficointerativo1 = | @@ -1484,7 +1486,7 @@ i3GEOF.graficointerativo1 = | ||
1484 | // | 1486 | // |
1485 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); | 1487 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1486 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); | 1488 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1487 | - | 1489 | + |
1488 | new pvc.LineChart(config).setData(dados, { | 1490 | new pvc.LineChart(config).setData(dados, { |
1489 | crosstabMode : ct, | 1491 | crosstabMode : ct, |
1490 | seriesInRows : sr | 1492 | seriesInRows : sr |
@@ -1519,7 +1521,7 @@ i3GEOF.graficointerativo1 = | @@ -1519,7 +1521,7 @@ i3GEOF.graficointerativo1 = | ||
1519 | // | 1521 | // |
1520 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); | 1522 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1521 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); | 1523 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1522 | - | 1524 | + |
1523 | new pvc.TreemapChart(config).setData(dados, { | 1525 | new pvc.TreemapChart(config).setData(dados, { |
1524 | crosstabMode : false | 1526 | crosstabMode : false |
1525 | }).render(); | 1527 | }).render(); |
@@ -1554,7 +1556,7 @@ i3GEOF.graficointerativo1 = | @@ -1554,7 +1556,7 @@ i3GEOF.graficointerativo1 = | ||
1554 | // | 1556 | // |
1555 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); | 1557 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1556 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); | 1558 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1557 | - | 1559 | + |
1558 | new pvc.PieChart(config).setData(dados, { | 1560 | new pvc.PieChart(config).setData(dados, { |
1559 | crosstabMode : false | 1561 | crosstabMode : false |
1560 | }).render(); | 1562 | }).render(); |
@@ -1658,13 +1660,11 @@ i3GEOF.graficointerativo1 = | @@ -1658,13 +1660,11 @@ i3GEOF.graficointerativo1 = | ||
1658 | dadosNovos, | 1660 | dadosNovos, |
1659 | metaNovos, | 1661 | metaNovos, |
1660 | rsNovos, | 1662 | rsNovos, |
1661 | - coresNovos, | ||
1662 | rs, | 1663 | rs, |
1663 | - nrs = [], | ||
1664 | a = {}, | 1664 | a = {}, |
1665 | b = {}, | 1665 | b = {}, |
1666 | e = [], | 1666 | e = [], |
1667 | - d, | 1667 | + d = "", |
1668 | j, | 1668 | j, |
1669 | nj; | 1669 | nj; |
1670 | if(n > 0){ | 1670 | if(n > 0){ |
@@ -1672,29 +1672,30 @@ i3GEOF.graficointerativo1 = | @@ -1672,29 +1672,30 @@ i3GEOF.graficointerativo1 = | ||
1672 | //inclui os metadados do grafico que sera sobreposto nos metadados do grafico original | 1672 | //inclui os metadados do grafico que sera sobreposto nos metadados do grafico original |
1673 | dadosNovos = i3GEOF.graficointerativo1.tabela2dados(c[i]); | 1673 | dadosNovos = i3GEOF.graficointerativo1.tabela2dados(c[i]); |
1674 | metaNovos = dadosNovos.dados.metadata; | 1674 | metaNovos = dadosNovos.dados.metadata; |
1675 | - coresNovos = dadosNovos.cores; | ||
1676 | nmeta = dados.metadata.length; | 1675 | nmeta = dados.metadata.length; |
1677 | nj = metaNovos.length; | 1676 | nj = metaNovos.length; |
1678 | for(j = 0;j<nj;j++){ | 1677 | for(j = 0;j<nj;j++){ |
1679 | - nmeta++; | ||
1680 | - dados.metadata.push({ | ||
1681 | - "colIndex" : nmeta, | ||
1682 | - "colType" : metaNovos[j].colType, | ||
1683 | - "colName" : metaNovos[j].colName | ||
1684 | - }) | 1678 | + if(metaNovos[j].colName != ""){ |
1679 | + nmeta++; | ||
1680 | + dados.metadata.push({ | ||
1681 | + "colIndex" : nmeta, | ||
1682 | + "colType" : metaNovos[j].colType, | ||
1683 | + "colName" : metaNovos[j].colName | ||
1684 | + }); | ||
1685 | + } | ||
1685 | } | 1686 | } |
1686 | //adiciona os dados | 1687 | //adiciona os dados |
1687 | rs = dados.resultset; | 1688 | rs = dados.resultset; |
1688 | nj = rs.length; | 1689 | nj = rs.length; |
1689 | //hash contendo os valores originais | 1690 | //hash contendo os valores originais |
1690 | for(j=0;j<nj;j++){ | 1691 | for(j=0;j<nj;j++){ |
1691 | - a[rs[j][0]] =rs[j]; | 1692 | + a[rs[j][0]] =rs[j]; |
1692 | } | 1693 | } |
1693 | rsNovos = dadosNovos.dados.resultset; | 1694 | rsNovos = dadosNovos.dados.resultset; |
1694 | nj = rsNovos.length; | 1695 | nj = rsNovos.length; |
1695 | //hash contendo os valores novos | 1696 | //hash contendo os valores novos |
1696 | for(j=0;j<nj;j++){ | 1697 | for(j=0;j<nj;j++){ |
1697 | - b[rsNovos[j][0]] =rsNovos[j]; | 1698 | + b[rsNovos[j][0]] =rsNovos[j]; |
1698 | } | 1699 | } |
1699 | //busca nos valores novos os dados com base na chave do hash original | 1700 | //busca nos valores novos os dados com base na chave do hash original |
1700 | for(d in a){ | 1701 | for(d in a){ |