diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-03 23:32:36 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-03 23:32:36 +0300 |
| commit | 278d2abaafa97a709fdcf5a34ed1df858d9ca51d (patch) | |
| tree | 94b18ddfa876818b9fb3dd3bb131d115f5090721 | |
| parent | d9ab7ba6ebf21ac5736fc0b0d982789b0c09ee3e (diff) | |
| download | gitlab-ce-278d2abaafa97a709fdcf5a34ed1df858d9ca51d.tar.gz | |
show commits count when hover chart on stats page
| -rw-r--r-- | app/assets/javascripts/chart.js.coffee | 11 | ||||
| -rw-r--r-- | app/assets/stylesheets/common.scss | 5 | ||||
| -rw-r--r-- | app/views/repositories/stats.html.haml | 11 |
3 files changed, 20 insertions, 7 deletions
diff --git a/app/assets/javascripts/chart.js.coffee b/app/assets/javascripts/chart.js.coffee index 7040ebc6c65..989f48e5e75 100644 --- a/app/assets/javascripts/chart.js.coffee +++ b/app/assets/javascripts/chart.js.coffee @@ -4,9 +4,18 @@ init: (labels, values, title) -> r = Raphael('activity-chart') + + fin = -> + @flag = r.popup(@bar.x, @bar.y, @bar.value or "0").insertBefore(this) + + fout = -> + @flag.animate + opacity: 0, 300, -> @remove() + r.text(160, 10, title).attr font: "13px sans-serif" r.barchart( - 10, 10, 400, 160, + 10, 20, 560, 200, [values], {colors:["#456"]} ).label(labels, true) + .hover(fin, fout) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 4e7aa968ea7..0f66536b2b4 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -555,3 +555,8 @@ img.emoji { text-shadow: 0 1px 1px #111; font-weight: normal; } + +.chart { + overflow: hidden; + height: 220px; +} diff --git a/app/views/repositories/stats.html.haml b/app/views/repositories/stats.html.haml index e8cf5eb908d..d448c669271 100644 --- a/app/views/repositories/stats.html.haml +++ b/app/views/repositories/stats.html.haml @@ -1,8 +1,8 @@ = render "commits/head" .row - .span5 - %h4 - Stats: + .span6 + %div#activity-chart.chart + %hr %p %b Total commits: %span= @stats.commits_count @@ -13,9 +13,8 @@ %b Authors: %span= @stats.authors_count - %br - %div#activity-chart - .span7 + + .span6 %h4 Top 50 Committers: %ol.styled - @stats.authors[0...50].each do |author| |
