DSD - PassRate

DSD - PassRate

by Dumine Stefan Daniel

HTML

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>


<div id="container" style="height: 400px"></div>

JavaScript

$(function() {
  $('#container').highcharts({
    chart: {},
    
    
    title: {
      text: 'uSON 5.1 PassRates',
      x: -20 //center
    },
   
    xAxis: {
      title: {
        text: 'Build'
      },
      
       labels: {
                  format: '<b>#</b>{value}'
                    },
                     
      categories: []
    },
    plotOptions: {
        series: {
            cursor: 'pointer',
            point: {
                events: {
                    click: function() {
                        alert(this.y);
                    }
                }
            }
        }
    },
    yAxis: [{ // Primary yAxis
                    min: 0, max: 100, tickInterval: 10,
                    title: {

                        text: 'Percentage (%)'
                    },
                    plotLines: [{
                        value: 0,
                        width: 1,
                        color: '#808080'
                    }]
                }],
                 tooltip: {
            shared: true,
            useHTML: true,
                pointFormat: "{series.name}: {point.y:.1f}<br />",
                headerFormat: "USON 5.1 #<b>{point.key} </b><br><br>",
        },
    legend: {
      layout: 'vertical',
      align: 'right',
      verticalAlign: 'middle',
      borderWidth: 0
    },
    series: [{
        name: 'PassRate',
        type: 'spline',
        yAxis: 0,
        data: [],
        tooltip: {
            valueSuffix: ' %'
        }

    }]
  });

  var build_ = [8, 9, 10];
       var passrate_ = [81.7, 92.2, 99.8];
       
       
       
       
       

passrate_ = passrate_.slice(passrate_.length-10, passrate_.length)
var chart = $('#container').highcharts();
    chart.series[0].setData(eval(passrate_), false, true);
    chart.xAxis[0].setCategories(eval(build_), true, true);
 
});