项目动态中版本库统计样式

beidou_tim
huang 9 years ago
parent 40b45ce1b4
commit 4a8d572cb1

@ -321,12 +321,14 @@ class ProjectsController < ApplicationController
end end
# g = Gitlab.client # g = Gitlab.client
unless @project.gpid.nil? || @project.project_score.changeset_num == 0 unless @project.gpid.nil? || @project.project_score.changeset_num == 0
rep_statics = @project.rep_statics rep_statics_commit = @project.rep_statics
@a_uname = rep_statics.map {|s| s.uname } rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse
@a_commits_num = rep_statics.map {|s| s.commits_num.to_i } @a_uname = rep_statics_commit.map {|s| s.uname }
@a_commits_add = rep_statics.map {|s| s.add.to_i } @a_uname_code = rep_statics_code.map {|s| s.uname }
@a_commits_del = rep_statics.map {|s| s.del.to_i } @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i }
@a_commits_changeset = rep_statics.map {|s| s.changeset.to_i } @a_commits_add = rep_statics_code.map {|s| s.add.to_i }
@a_commits_del = rep_statics_code.map {|s| s.del.to_i }
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
# @static_total_per_user = g.rep_stats(@project.gpid) # @static_total_per_user = g.rep_stats(@project.gpid)
end end
# 根据对应的请求,返回对应的数据 # 根据对应的请求,返回对应的数据

@ -21,7 +21,7 @@
}, },
xAxis: { xAxis: {
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] // categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
categories: <%= raw(@a_uname) %> categories: <%= raw(@a_uname_code) %>
}, },
yAxis: { yAxis: {
title: { title: {
@ -40,7 +40,7 @@
plotOptions: { plotOptions: {
series: { series: {
marker: { marker: {
radius: 3, //曲线点半径默认是4 radius: 3, //曲线点半径默认是4
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
} }
}, },
@ -51,23 +51,54 @@
enableMouseTracking: false enableMouseTracking: false
} }
}, },
series: [{ series: [
name: '改动或增加', {
color: '#fd9e04', name: '<b style="font-weight:normal ">总变更</b>',
color: '#d05d5a',
// data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6] fontWeight: 'normal',
data: <%= @a_commits_changeset %>,
dataLabels: {
enabled: false,
style: {
fontSize: '13px',
color: '#aaa',
fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal'
}
},
lineWidth: 1.5
},
{
name: '<b style="font-weight:normal ">改动或增加</b>',
color: '#5b6b76',
data: <%= @a_commits_add %>, data: <%= @a_commits_add %>,
dataLabels: {
enabled: false,
style: {
fontSize: '13px',
color: '#aaa',
fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal'
}
},
lineWidth: 1.5 lineWidth: 1.5
}, },
{ {
name: '删除', name: '<b style="font-weight:normal ">删除</b>',
color: '#46baed ', color: '#84b5bb',
data: <%= @a_commits_del %>, data: <%= @a_commits_del %>,
lineWidth: 1.5 dataLabels: {
},{ enabled: false,
name: '总变更', style: {
color: '#d397d5', fontSize: '13px',
data: <%= @a_commits_changeset %>, color: '#aaa',
fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal'
}
},
lineWidth: 1.5 lineWidth: 1.5
}] }]
}); });
@ -120,9 +151,22 @@
} }
}, },
series: [{ series: [{
name: '提交次数', name: '<b style="font-weight:normal ">提交次数</b>',
fontWeight: 'normal',
color: '#d05d5a',
// data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6] // data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
data: <%= @a_commits_num %>, data: <%= @a_commits_num %>,
dataLabels: {
enabled: false,
style: {
fontSize: '13px',
color: '#aaa',
fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal'
}
},
lineWidth: 1.5 lineWidth: 1.5
} }
@ -134,3 +178,4 @@
}); });
}); });
</script> </script>
<div class="button-rep">当前分支develop</div>

@ -1200,3 +1200,4 @@ a.chooseActive {background-color:#269ac9; color:#ffffff;}
.popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;} .popupClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:10px; top:5px;}
.subjectType {width:70px; text-align:center;} .subjectType {width:70px; text-align:center;}
.subjectCount {width:65px; text-align:center;} .subjectCount {width:65px; text-align:center;}
.button-rep { color: #888;display: inline-block;background: #eee;padding: 2px 5px;}

Loading…
Cancel
Save