From d39eb6a1454dae8fb1c0412378d4a4a062c45223 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 29 Mar 2015 05:25:52 +0000 Subject: [PATCH] updated styles of some graphs --- codepot/src/codepot/views/graph_main.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/views/graph_main.php b/codepot/src/codepot/views/graph_main.php index 8ef5ded4..896e87b1 100644 --- a/codepot/src/codepot/views/graph_main.php +++ b/codepot/src/codepot/views/graph_main.php @@ -215,6 +215,11 @@ function show_commits_per_month_graph(log) }); } +function labelFormatter(label, series) +{ + return "
" + label + "
" + Math.round(series.percent) + "%
"; +} + function show_commits_per_user_graph(log) { var commits_per_user = []; @@ -256,14 +261,16 @@ function show_commits_per_user_graph(log) show: true, fill: true, align: "center", - barWidth: 0.1 + barWidth: 0.8 } }, //grid: { hoverable: true, clickable: true }, xaxes: [ - { mode: "categories" }, + { mode: "categories", + autoscaleMargin: 0.1 + } ], yaxes: { } @@ -278,8 +285,17 @@ function show_commits_per_user_graph(log) shadowSize: 0, pie: { show: true, - fill: true + innerRadius: 0.1, + label: { + show: true, + radius: 7/10, + formatter: labelFormatter, + background: { opacity: 0.8 } + } } + }, + legend: { + show: true } }; $.plot($("#graph_main_commit_share_by_user"), commit_share_by_user, options);