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 | 65 | dicionario["idjanelaA"] = '"'+idjanela+'"'; |
66 | 66 | dicionario["locaplic"] = i3GEO.configura.locaplic; |
67 | 67 | dicionario["prop"] = $trad('p13'); |
68 | + dicionario["asp"] = '"'; | |
68 | 69 | return dicionario; |
69 | 70 | }, |
70 | 71 | /** |
... | ... | @@ -737,7 +738,9 @@ i3GEOF.graficointerativo1 = |
737 | 738 | } |
738 | 739 | }, |
739 | 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 | 744 | if (temp.value >= 0) { |
742 | 745 | if (tipo === "mais") { |
743 | 746 | temp.value = v + delta; |
... | ... | @@ -750,10 +753,10 @@ i3GEOF.graficointerativo1 = |
750 | 753 | } |
751 | 754 | $i(idjanela + "i3GEOgraficointerativo1guia4").onclick.call(); |
752 | 755 | }, |
753 | - alteraFatorPixelMenos : function(tipo, idjanela) { | |
756 | + alteraFatorPixelMenos : function(idjanela) { | |
754 | 757 | i3GEOF.graficointerativo1.alteraFatorPixel("menos", idjanela); |
755 | 758 | }, |
756 | - alteraFatorPixelMais : function(tipo, idjanela) { | |
759 | + alteraFatorPixelMais : function(idjanela) { | |
757 | 760 | i3GEOF.graficointerativo1.alteraFatorPixel("mais", idjanela); |
758 | 761 | }, |
759 | 762 | /** |
... | ... | @@ -1107,16 +1110,15 @@ i3GEOF.graficointerativo1 = |
1107 | 1110 | } |
1108 | 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 | 1116 | xInclinado = false; |
1116 | - | |
1117 | - var dados = i3GEOF.graficointerativo1.tabela2dados(idjanela); | |
1117 | + | |
1118 | + dados = i3GEOF.graficointerativo1.tabela2dados(idjanela); | |
1118 | 1119 | |
1119 | 1120 | xInclinado = $i(idjanela + "i3GEOgraficointerativo1xInclinado").checked; |
1121 | + /* | |
1120 | 1122 | if ($i(idjanela + "i3GEOgraficointerativo1ComboTemasId")) { |
1121 | 1123 | titulo = |
1122 | 1124 | $i(idjanela + "i3GEOgraficointerativo1ComboTemasId").options[$i(idjanela + "i3GEOgraficointerativo1ComboTemasId").options.selectedIndex].text; |
... | ... | @@ -1124,6 +1126,7 @@ i3GEOF.graficointerativo1 = |
1124 | 1126 | if (i3GEOF.graficointerativo1.titulo != "") { |
1125 | 1127 | titulo = i3GEOF.graficointerativo1.titulo; |
1126 | 1128 | } |
1129 | + */ | |
1127 | 1130 | if ($i(idjanela + "i3GEOgraficointerativo1ComboXid")) { |
1128 | 1131 | legendaX = $i(idjanela + "i3GEOgraficointerativo1ComboXidTitulo").value; |
1129 | 1132 | } |
... | ... | @@ -1132,7 +1135,6 @@ i3GEOF.graficointerativo1 = |
1132 | 1135 | } |
1133 | 1136 | |
1134 | 1137 | if (legendaX == legendaY && (legendaX != "" && legendaY != "")) { |
1135 | - menor = 0; | |
1136 | 1138 | legendaX += " (" + $trad('casos', i3GEOF.graficointerativo1.dicionario) + ")"; |
1137 | 1139 | legendaY += " (" + $trad('numeroCasos', i3GEOF.graficointerativo1.dicionario) + ")"; |
1138 | 1140 | } |
... | ... | @@ -1178,19 +1180,19 @@ i3GEOF.graficointerativo1 = |
1178 | 1180 | ncolunas = colunas[0].length, |
1179 | 1181 | temp = 0, |
1180 | 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 | 1196 | dados = {}; |
1195 | 1197 | if (ninputs > 0) { |
1196 | 1198 | menor = inputs[1].value * 1; |
... | ... | @@ -1394,7 +1396,7 @@ i3GEOF.graficointerativo1 = |
1394 | 1396 | return config; |
1395 | 1397 | }, |
1396 | 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 | 1400 | if (tipo === "horizontal") { |
1399 | 1401 | config.orientation = 'horizontal'; |
1400 | 1402 | } |
... | ... | @@ -1409,7 +1411,7 @@ i3GEOF.graficointerativo1 = |
1409 | 1411 | // |
1410 | 1412 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1411 | 1413 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1412 | - | |
1414 | + | |
1413 | 1415 | if (dados.resultset && dados.resultset[0] && dados.resultset[0].length > 2) { |
1414 | 1416 | config.stacked = $i(idjanela + "i3GEOFgraficointerativo1ativaStacked").checked; |
1415 | 1417 | config.legend = true; |
... | ... | @@ -1484,7 +1486,7 @@ i3GEOF.graficointerativo1 = |
1484 | 1486 | // |
1485 | 1487 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1486 | 1488 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1487 | - | |
1489 | + | |
1488 | 1490 | new pvc.LineChart(config).setData(dados, { |
1489 | 1491 | crosstabMode : ct, |
1490 | 1492 | seriesInRows : sr |
... | ... | @@ -1519,7 +1521,7 @@ i3GEOF.graficointerativo1 = |
1519 | 1521 | // |
1520 | 1522 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1521 | 1523 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1522 | - | |
1524 | + | |
1523 | 1525 | new pvc.TreemapChart(config).setData(dados, { |
1524 | 1526 | crosstabMode : false |
1525 | 1527 | }).render(); |
... | ... | @@ -1554,7 +1556,7 @@ i3GEOF.graficointerativo1 = |
1554 | 1556 | // |
1555 | 1557 | dados = i3GEOF.graficointerativo1.composicao.incluiDados(idjanela,dados); |
1556 | 1558 | config = i3GEOF.graficointerativo1.composicao.incluiConfig(idjanela,config); |
1557 | - | |
1559 | + | |
1558 | 1560 | new pvc.PieChart(config).setData(dados, { |
1559 | 1561 | crosstabMode : false |
1560 | 1562 | }).render(); |
... | ... | @@ -1658,13 +1660,11 @@ i3GEOF.graficointerativo1 = |
1658 | 1660 | dadosNovos, |
1659 | 1661 | metaNovos, |
1660 | 1662 | rsNovos, |
1661 | - coresNovos, | |
1662 | 1663 | rs, |
1663 | - nrs = [], | |
1664 | 1664 | a = {}, |
1665 | 1665 | b = {}, |
1666 | 1666 | e = [], |
1667 | - d, | |
1667 | + d = "", | |
1668 | 1668 | j, |
1669 | 1669 | nj; |
1670 | 1670 | if(n > 0){ |
... | ... | @@ -1672,29 +1672,30 @@ i3GEOF.graficointerativo1 = |
1672 | 1672 | //inclui os metadados do grafico que sera sobreposto nos metadados do grafico original |
1673 | 1673 | dadosNovos = i3GEOF.graficointerativo1.tabela2dados(c[i]); |
1674 | 1674 | metaNovos = dadosNovos.dados.metadata; |
1675 | - coresNovos = dadosNovos.cores; | |
1676 | 1675 | nmeta = dados.metadata.length; |
1677 | 1676 | nj = metaNovos.length; |
1678 | 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 | 1687 | //adiciona os dados |
1687 | 1688 | rs = dados.resultset; |
1688 | 1689 | nj = rs.length; |
1689 | 1690 | //hash contendo os valores originais |
1690 | 1691 | for(j=0;j<nj;j++){ |
1691 | - a[rs[j][0]] =rs[j]; | |
1692 | + a[rs[j][0]] =rs[j]; | |
1692 | 1693 | } |
1693 | 1694 | rsNovos = dadosNovos.dados.resultset; |
1694 | 1695 | nj = rsNovos.length; |
1695 | 1696 | //hash contendo os valores novos |
1696 | 1697 | for(j=0;j<nj;j++){ |
1697 | - b[rsNovos[j][0]] =rsNovos[j]; | |
1698 | + b[rsNovos[j][0]] =rsNovos[j]; | |
1698 | 1699 | } |
1699 | 1700 | //busca nos valores novos os dados com base na chave do hash original |
1700 | 1701 | for(d in a){ | ... | ... |