Generated pie charts in HTML view now handle re-sizing better.

This is accomplished with the use of the flot re-size plugin. Thanks to
this, pie charts no longer have to be set to a fixed size.
This commit is contained in:
Adam Waldenberg 2013-07-27 23:48:34 +02:00
parent 0664702b8f
commit 20d82273ec
2 changed files with 6 additions and 2 deletions

View file

@ -66,6 +66,7 @@ def output_header():
tablesorter_js = __get_zip_file_content__("jquery.tablesorter.min.js", "/html/jquery.tablesorter.min.js.zip") tablesorter_js = __get_zip_file_content__("jquery.tablesorter.min.js", "/html/jquery.tablesorter.min.js.zip")
flot_js = __get_zip_file_content__("jquery.flot.js") flot_js = __get_zip_file_content__("jquery.flot.js")
pie_js = __get_zip_file_content__("jquery.flot.pie.js") pie_js = __get_zip_file_content__("jquery.flot.pie.js")
resize_js = __get_zip_file_content__("jquery.flot.resize.js")
logo_file = open(base + "/html/gitinspector_piclet.png", "rb") logo_file = open(base + "/html/gitinspector_piclet.png", "rb")
logo = logo_file.read() logo = logo_file.read()
@ -82,6 +83,7 @@ def output_header():
jquery_tablesorter = tablesorter_js, jquery_tablesorter = tablesorter_js,
jquery_flot = flot_js, jquery_flot = flot_js,
jquery_flot_pie = pie_js, jquery_flot_pie = pie_js,
jquery_flot_resize = resize_js,
logo = logo.decode("utf-8", "replace"), logo = logo.decode("utf-8", "replace"),
logo_text = _("The output has been generated by {0}; the statistical analysis tool" logo_text = _("The output has been generated by {0}; the statistical analysis tool"
" for git repositories.").format( " for git repositories.").format(

View file

@ -7,6 +7,7 @@
<script type="application/javascript">{jquery_tablesorter}</script> <script type="application/javascript">{jquery_tablesorter}</script>
<script type="application/javascript">{jquery_flot}</script> <script type="application/javascript">{jquery_flot}</script>
<script type="application/javascript">{jquery_flot_pie}</script> <script type="application/javascript">{jquery_flot_pie}</script>
<script type="application/javascript">{jquery_flot_resize}</script>
<script type="application/javascript"> <script type="application/javascript">
$(document).ready(function() {{ $(document).ready(function() {{
var row = 0; var row = 0;
@ -181,7 +182,7 @@
body > div > div > div {{ body > div > div > div {{
position: relative; position: relative;
width: 100%; width: 100%;
min-height: 215px; min-height: 140px;
}} }}
table.git {{ table.git {{
font-size: small; font-size: small;
@ -232,8 +233,9 @@
bottom: 5px; bottom: 5px;
right: 0px; right: 0px;
width: 35%; width: 35%;
min-height: 100px;
max-height: 210px;
font-size: x-small; font-size: x-small;
height: 210px;
}} }}
p.error {{ p.error {{
color: #700; color: #700;