Simple Burndown Chart with Highcharts

In this article we will take next steps to learn highcharts, here we are creating Burndown chart based on Line chart with high charts. Burndown chart is “A chart is a graphical representation of work left to do versus time. The outstanding work (or backlog) is often on the vertical axis, with time along the horizontal”.

Checkout other tutorial of Charting,

Burndown chart is very important for agile project when you want to track your work with time. The burndown chart can be project/Team and sprint wise. The burndown chart helps you to see what is happening and what to do complete your work with in time. There are following steps to need create burndown chart.

burndown_chart

Step 1: Need to include highchart library files in your project.You can download from Here.

Step 2: Create PHP sample data array which is used to create Burndown chart.

$actualArray = array(0, 1, 1,1,4);

$idealArray = range(0, 10, 1);
$idealXArray = array();
foreach ($idealArray as $value){
    $value = trim($value);
    $idealXArray[] = 'Day '.$value;
}

Here $actualArray is timesheet entry and $idealArray is days to defined complete work.

Step 3: Create div element which is used as a container for Brundown chart.

<div id="container-burndown" style="max-width: 510px; height: 400px;"></div>









Step 4: Initializing Highcharts library by calling method highcharts on target container.

<script>
jQuery(document).ready(function() {
var doc = $(document);
$('#container-burndown').highcharts({
    title: {
      text: 'Burndown Chart of Project',
      x: -10 //center
    },
	scrollbar: {
                barBackgroundColor: 'gray',
                barBorderRadius: 7,
                barBorderWidth: 0,
                buttonBackgroundColor: 'gray',
                buttonBorderWidth: 0,
                buttonBorderRadius: 7,
                trackBackgroundColor: 'none',
                trackBorderWidth: 1,
                trackBorderRadius: 8,
                trackBorderColor: '#CCC'
            },
    colors: ['blue', 'red'],
    plotOptions: {
      line: {
        lineWidth: 3
      },
      tooltip: {
        hideDelay: 200
      }
    },
    subtitle: {
      text: 'All Project Team Summary',
      x: -10
    },
    xAxis: {
      categories: <?php echo json_encode($idealXArray);?>
    },
    yAxis: {
      title: {
        text: 'Remaining work (days)'
		
      },
			 type: 'linear',
			 max:10,
			 min:0,
			 tickInterval :1
	 
    },
	
    tooltip: {
      valueSuffix: ' day',
      crosshairs: true,
      shared: true
    },
    legend: {
     layout: 'horizontal',
      align: 'center',
      verticalAlign: 'bottom',
      borderWidth: 0
    },
    series: [{
      name: 'Ideal Burn',
      color: 'rgba(255,0,0,0.25)',
      lineWidth: 2,
	  
      data: <?php echo json_encode(array_reverse($idealArray));?>
    }, {
      name: 'Actual Burn',
      color: 'rgba(0,120,200,0.75)',
      marker: {
        radius: 6
      },
      data: <?php echo json_encode($actualArray);?>
    }]
  });
    });
</script>

I hope it would help you!.

You can see live Demo and download Source Code below

One thought on “Simple Burndown Chart with Highcharts

Leave a Reply

Your email address will not be published. Required fields are marked *