Commit 278d2abaafa97a709fdcf5a34ed1df858d9ca51d

Authored by Dmitriy Zaporozhets
1 parent d9ab7ba6

show commits count when hover chart on stats page

app/assets/javascripts/chart.js.coffee
@@ -4,9 +4,18 @@ @@ -4,9 +4,18 @@
4 4
5 init: (labels, values, title) -> 5 init: (labels, values, title) ->
6 r = Raphael('activity-chart') 6 r = Raphael('activity-chart')
  7 +
  8 + fin = ->
  9 + @flag = r.popup(@bar.x, @bar.y, @bar.value or "0").insertBefore(this)
  10 +
  11 + fout = ->
  12 + @flag.animate
  13 + opacity: 0, 300, -> @remove()
  14 +
7 r.text(160, 10, title).attr font: "13px sans-serif" 15 r.text(160, 10, title).attr font: "13px sans-serif"
8 r.barchart( 16 r.barchart(
9 - 10, 10, 400, 160, 17 + 10, 20, 560, 200,
10 [values], 18 [values],
11 {colors:["#456"]} 19 {colors:["#456"]}
12 ).label(labels, true) 20 ).label(labels, true)
  21 + .hover(fin, fout)
app/assets/stylesheets/common.scss
@@ -555,3 +555,8 @@ img.emoji { @@ -555,3 +555,8 @@ img.emoji {
555 text-shadow: 0 1px 1px #111; 555 text-shadow: 0 1px 1px #111;
556 font-weight: normal; 556 font-weight: normal;
557 } 557 }
  558 +
  559 +.chart {
  560 + overflow: hidden;
  561 + height: 220px;
  562 +}
app/views/repositories/stats.html.haml
1 = render "commits/head" 1 = render "commits/head"
2 .row 2 .row
3 - .span5  
4 - %h4  
5 - Stats: 3 + .span6
  4 + %div#activity-chart.chart
  5 + %hr
6 %p 6 %p
7 %b Total commits: 7 %b Total commits:
8 %span= @stats.commits_count 8 %span= @stats.commits_count
@@ -13,9 +13,8 @@ @@ -13,9 +13,8 @@
13 %b Authors: 13 %b Authors:
14 %span= @stats.authors_count 14 %span= @stats.authors_count
15 15
16 - %br  
17 - %div#activity-chart  
18 - .span7 16 +
  17 + .span6
19 %h4 Top 50 Committers: 18 %h4 Top 50 Committers:
20 %ol.styled 19 %ol.styled
21 - @stats.authors[0...50].each do |author| 20 - @stats.authors[0...50].each do |author|