aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/perf_monitoring/resources/chart_footer.html
blob: 8acc69f14d41a98e3297b062047849d4c4de186b (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
34
35
36
37
      /* setup the chart and its options */                                                                                
      var chart = nv.models.lineChart()                                                                                    
                    .color(d3.scale.category10().range())                                                                  
                    .margin({left: 75, bottom: 100})                                                                        
                    .forceX([0]).forceY([0]);                                                                              
                                                                                                                           
      chart.x(function(datum){ return datum.r; })                                                                          
           .xAxis.options({                                                                                                
             axisLabel: customSettings.XLABEL || 'Changeset',
             tickFormat: d3.format('.0f')                                                                                  
           });
      chart.xAxis
        .tickValues(changesets_count)
        .tickFormat(function(d){return changesets[d]})
        .rotateLabels(-90);
                                                                                                                                                                                                       
        chart.y(function(datum){ return datum.v; })                                                    
             .yAxis.options({                                                                                              
               axisLabel: customSettings.YLABEL || 'GFlops'/*,
               tickFormat: function(val){ return d3.format('.0f')(val) + ' GFlops'; }*/
             });
      
      //chart.useInteractiveGuideline(true);
      d3.select('#chart').datum(data).call(chart);                                                                         
      var plot = d3.select('#chart > g');                                                                                  
                                                                                                                           
      /* setup the title */                                                                                                
      plot.append('text')                                                                                                  
          .style('font-size', '24px')                                                                                      
          .attr('text-anchor', 'middle').attr('x', '50%').attr('y', '20px')                                                
          .text(customSettings.TITLE || '');                                                                                                                   
                                                                                                                           
      /* ensure the chart is responsive */                                                                                 
      nv.utils.windowResize(chart.update);                                                                                 
    </script>                                                                                                              
  </body>                                                                                                                  
</html>