项目动态中版本库统计样式
This commit is contained in:
parent
40b45ce1b4
commit
4a8d572cb1
|
@ -321,12 +321,14 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
# g = Gitlab.client
|
||||
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
|
||||
rep_statics = @project.rep_statics
|
||||
@a_uname = rep_statics.map {|s| s.uname }
|
||||
@a_commits_num = rep_statics.map {|s| s.commits_num.to_i }
|
||||
@a_commits_add = rep_statics.map {|s| s.add.to_i }
|
||||
@a_commits_del = rep_statics.map {|s| s.del.to_i }
|
||||
@a_commits_changeset = rep_statics.map {|s| s.changeset.to_i }
|
||||
rep_statics_commit = @project.rep_statics
|
||||
rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse
|
||||
@a_uname = rep_statics_commit.map {|s| s.uname }
|
||||
@a_uname_code = rep_statics_code.map {|s| s.uname }
|
||||
@a_commits_num = rep_statics_commit.map {|s| s.commits_num.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)
|
||||
end
|
||||
# 根据对应的请求,返回对应的数据
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
xAxis: {
|
||||
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
categories: <%= raw(@a_uname) %>
|
||||
categories: <%= raw(@a_uname_code) %>
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
|
@ -40,7 +40,7 @@
|
|||
plotOptions: {
|
||||
series: {
|
||||
marker: {
|
||||
radius: 3, //曲线点半径,默认是4
|
||||
radius: 3, //曲线点半径,默认是4
|
||||
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
|
||||
}
|
||||
},
|
||||
|
@ -51,23 +51,54 @@
|
|||
enableMouseTracking: false
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '改动或增加',
|
||||
color: '#fd9e04',
|
||||
|
||||
// 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]
|
||||
series: [
|
||||
{
|
||||
name: '<b style="font-weight:normal ">总变更</b>',
|
||||
color: '#d05d5a',
|
||||
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 %>,
|
||||
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: '删除',
|
||||
color: '#46baed ',
|
||||
name: '<b style="font-weight:normal ">删除</b>',
|
||||
color: '#84b5bb',
|
||||
data: <%= @a_commits_del %>,
|
||||
lineWidth: 1.5
|
||||
},{
|
||||
name: '总变更',
|
||||
color: '#d397d5',
|
||||
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
|
||||
}]
|
||||
});
|
||||
|
@ -120,9 +151,22 @@
|
|||
}
|
||||
},
|
||||
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: <%= @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
|
||||
|
||||
}
|
||||
|
@ -133,4 +177,5 @@
|
|||
]
|
||||
});
|
||||
});
|
||||
</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;}
|
||||
.subjectType {width:70px; text-align:center;}
|
||||
.subjectCount {width:65px; text-align:center;}
|
||||
.button-rep { color: #888;display: inline-block;background: #eee;padding: 2px 5px;}
|
||||
|
|
Loading…
Reference in New Issue