
  Highcharts.setOptions({
      global : {
          useUTC : false
      }
  });

  $('#agent_execution_time_chart').highcharts({
         chart: {
             plotBackgroundColor: null,
             plotBorderWidth: null,
             plotShadow: false,
             type: 'pie'
         },
         title: {
             text: 'Test execution time by agents'
         },
         tooltip: {
             pointFormat: '<b>{point.percentage:.1f}%</b>'
         },
         plotOptions: {
             pie: {
                 allowPointSelect: true,
                 cursor: 'pointer',
                 dataLabels: {
                     enabled: true,
                     /* format: '{point.name}: {point.percentage:.1f} %', */
                     format: '{point.name}', 
                     style: {
                         color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                     }
                 }
             }
         },
         series: [{
             name: 'Execution time',
             colorByPoint: true,
             data: <%= raw @data.to_json %>
         }]
     });

$("#agent_charts_dialog").modal("show");

$("#agent_test_count_div").html("<h6>&nbsp;</h6><table class='table table-condensed table-striped'><%  @build_agent_count.sort.each do |name, count| %><tr><td><%= name %></td> <td><b><%= count.to_i %></b></td></tr><% end %></table>")
