mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-03-18 14:28:00 +01:00
The two generated pie graphs now use the same colors (Fixes issue 26).
The same author should have the same color in the two graphs, something that is more consistent and logical.
This commit is contained in:
parent
a1e90d0a9d
commit
02e0858985
3 changed files with 17 additions and 2 deletions
gitinspector
|
@ -229,7 +229,7 @@ class BlameOutput(Outputable):
|
|||
blame_xml += "<tfoot><tr> <td colspan=\"5\"> </td> </tr></tfoot></tbody></table>"
|
||||
blame_xml += "<div class=\"chart\" id=\"blame_chart\"></div></div>"
|
||||
blame_xml += "<script type=\"text/javascript\">"
|
||||
blame_xml += " $.plot($(\"#blame_chart\"), [{0}], {{".format(chart_data)
|
||||
blame_xml += " blame_plot = $.plot($(\"#blame_chart\"), [{0}], {{".format(chart_data)
|
||||
blame_xml += " series: {"
|
||||
blame_xml += " pie: {"
|
||||
blame_xml += " innerRadius: 0.4,"
|
||||
|
|
|
@ -241,7 +241,7 @@ class ChangesOutput(Outputable):
|
|||
changes_xml += ("<tfoot><tr> <td colspan=\"5\"> </td> </tr></tfoot></tbody></table>")
|
||||
changes_xml += "<div class=\"chart\" id=\"changes_chart\"></div></div>"
|
||||
changes_xml += "<script type=\"text/javascript\">"
|
||||
changes_xml += " $.plot($(\"#changes_chart\"), [{0}], {{".format(chart_data)
|
||||
changes_xml += " changes_plot = $.plot($(\"#changes_chart\"), [{0}], {{".format(chart_data)
|
||||
changes_xml += " series: {"
|
||||
changes_xml += " pie: {"
|
||||
changes_xml += " innerRadius: 0.4,"
|
||||
|
|
|
@ -142,6 +142,21 @@
|
|||
this.hoveredElement.removeClass("piehover");
|
||||
}}
|
||||
}});
|
||||
|
||||
// Make sure the two pie charts use the same colors.
|
||||
|
||||
var author_colors = {{}};
|
||||
$.each(changes_plot.getData(), function(i, v) {{
|
||||
author_colors[v["label"]] = v["color"];
|
||||
}});
|
||||
|
||||
$.each(blame_plot.getData(), function(i, v) {{
|
||||
if (author_colors[v["label"]] != undefined) {{
|
||||
v["color"] = author_colors[v["label"]];
|
||||
}}
|
||||
}});
|
||||
|
||||
blame_plot.draw();
|
||||
}});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
|
|
Loading…
Add table
Reference in a new issue