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

$('#performance_test_history_chart').highcharts({
      chart: {
          type: 'column'
      },
      title: {
          text: 'Recent performance test results and time'
      },
     xAxis: {
        categories: <%= raw @recent_build_times.collect{|x| x[:time].localtime.strftime('%Y-%m-%d %H:%M')}.inspect rescue [] %>
     },
      yAxis: {
          min: 0,
          title: {
              text: 'Time (s)'
          }
      },
      tooltip: {
		  formatter: function() {
              return this.y + ' secs';
          }
      },
      plotOptions: {
      },
      series: [
        {
		  showInLegend: false,
          enableMouseTracking: true,							 						
          data: [
            <% @recent_build_times.each do |entry| %>
            {
              y: <%= entry[:duration] %>,
              color: '<%= entry[:color] %>'
            },
            <% end %>
          ]          
        }
	  ]
  });




$("#performance_test_history_header").html("<%= @operation_name %>");
$("#performance_test_history_dialog").modal("show");