Browse Source

Acrescentada marca de faixa ideal no gauge das metas, no dashboard

stable/1.0
Sesostris Vieira 12 years ago
parent
commit
f7a4d6d555
  1. 12
      sigi/apps/metas/models.py
  2. 5
      sigi/templates/snippets/modules/charts-convenios.html

12
sigi/apps/metas/models.py

@ -53,14 +53,14 @@ class Meta(models.Model):
meses_gastos = (date.today() - self.data_inicio).days / 30 meses_gastos = (date.today() - self.data_inicio).days / 30
meta_mensal = self.valor_meta / total_meses meta_mensal = self.valor_meta / total_meses
return meta_mensal * meses_gastos return meta_mensal * meses_gastos
@property @property
def valor_desejado_high(self): def percentual_desejado_low(self):
return self.valor_desejado * 1.1 return self.valor_desejado * 0.9 / self.valor_meta
@property @property
def valor_desejado_low(self): def percentual_desejado_high(self):
return self.valor_desejado * 0.9 return self.valor_desejado * 1.1 / self.valor_meta
@property @property
def saude(self): def saude(self):

5
sigi/templates/snippets/modules/charts-convenios.html

@ -127,11 +127,8 @@
{% for meta in metas %} {% for meta in metas %}
<tr> <tr>
<td><strong>{{ meta.titulo }}</strong></td> <td><strong>{{ meta.titulo }}</strong></td>
<!-- th><meter style="width:100%;" min="0" max="100" low="{% widthratio meta.valor_desejado_low meta.valor_meta 100 %}"
high="{% widthratio meta.valor_desejado_high meta.valor_meta 100 %}" optimum="100"
value="{% widthratio meta.valor_ultimo_calculo meta.valor_meta 100 %}"></meter></th -->
<td> <td>
<img src="//chart.googleapis.com/chart?chf=c,s,CDCDCD&chbh=a&chs=250x18&cht=bhs&chco={{ meta.saude }}&chd=t:{{ meta.percentual_concluido|stringformat:'d' }}" <img src="//chart.googleapis.com/chart?chf=c,s,CDCDCD&chbh=a&chs=250x18&cht=bhs&chco={{ meta.saude }}&chd=t:{{ meta.percentual_concluido|stringformat:'d' }}&chm=r,00000034,0,{{ meta.percentual_desejado_low|stringformat:'f' }},{{ meta.percentual_desejado_high|stringformat:'f' }},1"
width="100%" alt="" /> width="100%" alt="" />
</td> </td>
<td style="text-align: center;"><font color="{{ meta.saude }}">{{ meta.percentual_concluido }}%</font></td> <td style="text-align: center;"><font color="{{ meta.saude }}">{{ meta.percentual_concluido }}%</font></td>

Loading…
Cancel
Save