summaryrefslogtreecommitdiff
path: root/app/views/projects/graphs/ci/_build_times.haml
blob: c58223fd39e644c66e6d9f71e9a9dd97ab2e82fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%div
  %p.light
    Commit duration in minutes for last 30 commits

  %canvas#build_timesChart{height: 200}

:javascript
  var data = {
    labels : #{@charts[:build_times].labels.to_json},
    datasets : [
      {
        fillColor : "rgba(220,220,220,0.5)",
        strokeColor : "rgba(220,220,220,1)",
        barStrokeWidth: 1,
        barValueSpacing: 1,
        barDatasetSpacing: 1,
        data : #{@charts[:build_times].build_times.to_json}
      }
    ]
  }
  var ctx = $("#build_timesChart").get(0).getContext("2d");
  new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, maintainAspectRatio: false});