summaryrefslogtreecommitdiff
path: root/app/views/projects/graphs/languages.html.haml
blob: fcfcae0be2098df40bd7c76e10e2fd4906faef3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
- @no_container = true
- page_title "Languages", "Graphs"
= render 'head'

%div{ class: container_class }
  .sub-header-block
    .oneline
      Programming languages used in this repository

  .row
    .col-md-8
      %canvas#languages-chart{ height: 400 }
    .col-md-4
      %ul.bordered-list
        - @languages.each do |language|
          %li
            %span{ style: "color: #{language[:color]}" }
              = icon('circle')
             
            = language[:label]
            .pull-right
              = language[:value]
              \%

:javascript
  var data = #{@languages.to_json};
  var ctx = $("#languages-chart").get(0).getContext("2d");
  var options = {
    scaleOverlay: true,
    responsive: true,
    maintainAspectRatio: false
  }
  var myPieChart = new Chart(ctx).Pie(data, options);