|
|
@ -3,6 +3,7 @@ |
|
|
|
{% block content_title %}<h1>Graficos dos Diagnósticos</h1>{% endblock %} |
|
|
|
|
|
|
|
{% block extrahead %} |
|
|
|
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css"> |
|
|
|
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> |
|
|
|
<script type="text/javascript" src="{{ STATIC_URL }}js/Chart.min.js"></script> |
|
|
|
<script src="http://code.highcharts.com/highcharts.js"></script> |
|
|
@ -24,6 +25,13 @@ jQuery(document).ready(function () { |
|
|
|
var ctx = document.getElementById(output_id).getContext("2d"); |
|
|
|
var myNewChart = new Chart(ctx).Pie(data); |
|
|
|
|
|
|
|
var canvas = $("#canvas_" + id); |
|
|
|
if (canvas.has('.pie-legend').length == 0) { |
|
|
|
var legendHolder = document.createElement('div'); |
|
|
|
legendHolder.innerHTML = myNewChart.generateLegend(); |
|
|
|
canvas.append(legendHolder.firstChild); |
|
|
|
} |
|
|
|
|
|
|
|
$('#canvas_' + id).toggle(); |
|
|
|
}, |
|
|
|
|
|
|
|