socialforge/app/views/projects/_rep_static.html.erb

191 lines
6.6 KiB
Plaintext
Raw Normal View History

2016-04-14 11:18:17 +08:00
<%= javascript_include_tag 'highcharts','highcharts-more' %>
<div id = "container" style="max-width:360px;min-height:400px;width:370px;float: left">
</div>
<div id = "container_code" style="max-width:360px;min-height:400px;width:370px;float: left">
</div>
<script>
$(function () {
$('#container_code').highcharts({
chart: {
type: 'line'
},
title: {
text: '版本库代码提交行数',
style:{
fontSize: '14px'
}
2016-04-14 11:18:17 +08:00
},
subtitle: {
// text: 'Source: WorldClimate.com'
},
xAxis: {
2016-05-10 17:07:47 +08:00
title: {
text: '作者',
x: -23, //center设置标题的位置
y: 6
},
2016-04-14 11:18:17 +08:00
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
2016-04-15 15:38:08 +08:00
categories: <%= raw(@a_uname_code) %>
2016-04-14 11:18:17 +08:00
},
yAxis: {
title: {
text: '代码行数'
}
},
credits:{
enabled: false
},
tooltip: {
enabled: false,
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y +'°C';
}
},
plotOptions: {
series: {
marker: {
2016-04-15 15:38:08 +08:00
radius: 3, //曲线点半径默认是4
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
}
},
2016-04-14 11:18:17 +08:00
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
2016-04-15 15:38:08 +08:00
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
},
{
2016-05-10 17:07:47 +08:00
name: '<b style="font-weight:normal;text-align: center ">改动或增加</b>',
2016-04-15 15:38:08 +08:00
color: '#5b6b76',
data: <%= @a_commits_add %>,
2016-04-15 15:38:08 +08:00
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
2016-04-14 11:18:17 +08:00
},
{
2016-04-15 15:38:08 +08:00
name: '<b style="font-weight:normal ">删除</b>',
color: '#84b5bb',
data: <%= @a_commits_del %>,
2016-04-15 15:38:08 +08:00
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
2016-04-14 11:18:17 +08:00
}]
});
// 代码提交次数统计
$('#container').highcharts({
chart: {
type: 'line'
},
credits:{
enabled: false
},
title: {
text: '版本库代码提交次数',
style:{
fontSize: '14px'
}
2016-04-14 11:18:17 +08:00
},
subtitle: {
// text: 'Source: WorldClimate.com'
},
xAxis: {
2016-05-10 17:07:47 +08:00
title: {
text: '作者',
x: -20, //center设置标题的位置
y: 6
},
2016-04-14 11:18:17 +08:00
// categories: ["Jan", "Jan", "Jan", 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
categories: <%= raw(@a_uname) %>
2016-04-14 11:18:17 +08:00
},
yAxis: {
title: {
text: '次'
}
},
tooltip: {
enabled: false,
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+this.x +': '+ this.y +'°C';
}
},
plotOptions: {
series: {
marker: {
radius: 3, //曲线点半径默认是4
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
}
},
2016-04-14 11:18:17 +08:00
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
2016-04-15 15:38:08 +08:00
name: '<b style="font-weight:normal ">提交次数</b>',
fontWeight: 'normal',
color: '#d05d5a',
2016-04-14 11:18:17 +08:00
// 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 %>,
2016-04-15 15:38:08 +08:00
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
2016-04-14 11:18:17 +08:00
}
// {
// name: 'London',
// data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
// }
]
});
});
2016-04-15 15:38:08 +08:00
</script>
2016-04-15 15:53:29 +08:00
<div class="button-rep">当前分支:<%= @rev %></div>