diff --git a/sigi/context_processors.py b/sigi/context_processors.py index 4d1a577..8551a5a 100644 --- a/sigi/context_processors.py +++ b/sigi/context_processors.py @@ -128,7 +128,6 @@ def grafico_convenio_projeto(convenios): '#8d4653', '#91e8e1', ]) - # colors = cycle(base_colors) highlights = cycle(['#B0D3F4', '#8E8E91', '#BCF4B1', @@ -147,6 +146,9 @@ def grafico_convenio_projeto(convenios): colors.next(), highlights.next()) for projeto in projetos] + # remove projetos sem convenio + lista_projetos = [x for x in lista_projetos if x[1] > 0] + # print lista_projetos # total_convenios = "Total: " + str(convenios.count()) # lista_projetos.insert(0, total_convenios) diff --git a/sigiStatic/css/style.css b/sigiStatic/css/style.css index 5ccc756..685d20c 100644 --- a/sigiStatic/css/style.css +++ b/sigiStatic/css/style.css @@ -1,13 +1,14 @@ -#canvas-holder { +#canvas-holder-1, #canvas-holder-2 { padding: 20px 20px 20px 20px; min-height: 180px; position: relative; - margin-top: 110px; + margin-top: 47px; + margin-left: 20px; } .pie-legend { list-style: none; position: absolute; - right: 8px; + right: 50px; top: 18px; } .pie-legend li span { diff --git a/templates/index.html b/templates/index.html index dbf2ecb..c3dea67 100644 --- a/templates/index.html +++ b/templates/index.html @@ -63,29 +63,21 @@ {% endfor %} ] window.onload = function(){ - var canvas = document.getElementById("canvas-holder"); + var canvas1 = document.getElementById("canvas-holder-1"); var ctx = document.getElementById("chart-area-1").getContext("2d"); - window.myPie = new Chart(ctx).Pie(pieData1); - var ctx = document.getElementById("chart-area-2").getContext("2d"); - window.myPie = new Chart(ctx).Pie(pieData2); + window.myPie = new Chart(ctx).Pie(pieData1).generateLegend(); var legendHolder = document.createElement('div'); - legendHolder.innerHTML = myPie.generateLegend(); - // Include a html legend template after the module doughnut itself -{# var helpers = Chart.helpers;#} -{# helpers.each(legendHolder.firstChild.childNodes, function(legendNode, index){#} -{# helpers.addEvent(legendNode, 'mouseover', function(){#} -{# var activeSegment = myPie.segments[index];#} -{# activeSegment.save();#} -{# activeSegment.fillColor = activeSegment.highlightColor;#} -{# myPie.showTooltip([activeSegment]);#} -{# activeSegment.restore();#} -{# });#} -{# });#} -{# helpers.addEvent(legendHolder.firstChild, 'mouseout', function(){#} -{# myPie.draw();#} -{# });#} - canvas.appendChild(legendHolder.firstChild); + legendHolder.innerHTML = myPie; + canvas1.appendChild(legendHolder.firstChild); + + var canvas2 = document.getElementById("canvas-holder-2"); + var ctx2 = document.getElementById("chart-area-2").getContext("2d"); + window.myPie2 = new Chart(ctx2).Pie(pieData2); + + var legendHolder2 = document.createElement('div'); + legendHolder2.innerHTML = myPie2.generateLegend(); + canvas2.appendChild(legendHolder2.firstChild); }; {% endfor %} diff --git a/templates/snippets/modules/charts-convenios.html b/templates/snippets/modules/charts-convenios.html index 96fe87e..d0e8900 100644 --- a/templates/snippets/modules/charts-convenios.html +++ b/templates/snippets/modules/charts-convenios.html @@ -28,19 +28,10 @@

Convênios

-
- +

Convênios assinados por projeto

+
+
-{#
#} -{#
    #} -{# {% for num, dados in dados_graficos_convenio_projeto %}#} -{# {% for label, value, color in dados %}#} -{#
  •     {{ label }}
  • #} -{# {% endfor %}#} -{# {% endfor %}#} -{#
#} -{#
#} -{#
    #}
    @@ -94,8 +85,9 @@

    Convênios

    -
    - +

    Processos de convênios por projeto

    +
    +
    @@ -105,45 +97,5 @@ - {% comment %} -

    Metas BID

    -

    Estado das metas do contrato BID

    - - {% for meta in metas %} - - - - - - {% endfor %} -
    {{ meta.titulo }} - - {{ meta.percentual_concluido }}%
    -
    -
     
    Ruim
    -
     
    Preocupante
    -
     
    Bom
    -
     
    Atingido
    -
    -{% endcomment %}
    -{% comment %} -
    -

    Diagnósticos

    -

    Resumo dos diagnósticos

    - - - {% for data in tabela_resumo_diagnostico %} - - - - - {% endfor %} - -
    {{ data.title }}{{ data.count }}
    Ver mapa ampliado
    - -
    -
    -
    -{% endcomment %} +