	<!DOCTYPE HTML>
	<html>
	<head>  
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script src="js/jquery-1.9.1.js" type="text/javascript"></script>
	<link href="https://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet"> 
	
	<script type="text/javascript">
	$(function () {
	Highcharts.setOptions({
	lang: {
	thousandsSep: ',',
	numericSymbols: null //otherwise by default ['k', 'M', 'G', 'T', 'P', 'E']
	}
	});
	$('#total_killings').highcharts({
	chart: {
	events: {
            load: function() {
                this.renderer.image('http://newsplex.nation.co.ke/newsplex_watermark.png', '80%','93%', 60, 29)
                    .add();
            },
        },
	type: 'bar',
	style: {
	fontFamily: 'Helvetica',
	fontSize: '20px'
	},
	},
	title: {
	text: '2016 total killings by police in Kenya, by County'
	},
	subtitle: {
	text: ''
	},
	credits: {
	enabled: false
	},
	xAxis: {
	categories: [
	<?php
	$servername = "localhost";
	$dbuser = "plexusrs";
	$dbpass = "sTUmTaQsSsPtRJy";
	$dbname = "newsplex_db";
	try {
	$conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbuser, $dbpass);
	// set the PDO error mode to exception
	$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$year2016='2016';
	//group by gender
	$sthandler = $conn->prepare("select county,killed from police_killings_per_county2016 where killed !='0' order by killed desc");
	$sthandler->bindParam(':year2016', $year2016);
	$sthandler->execute();
	$county = $sthandler->fetchAll();
	foreach ($county as $row) {
	echo '"'.$row['county'].'"'.",";
	}
	}
	catch(PDOException $e)
	{
	echo "error" . "<br>" . $e->getMessage();
	}
	$conn = null;

	?>
	],
	labels: {
	style: {
	font: '16px Helvetica, sans-serif'
	}
	},
	crosshair: true
	},
	yAxis: {
	//min: 0,
	//max: 80,
	title: {
	text: ''
	}
	},
	tooltip: {
	style: {
	fontFamily: 'Helvetica',
	fontSize: '18px'
	},
	formatter: function() {
	return this.x+'<br/>'+'<b>'+ Highcharts.numberFormat(this.y, 0) +'</b>';
	}
	},
	plotOptions: {
	bar: {
	//pointPadding: 0.2,
	//borderWidth: 1,
	//pointWidth: 20
	}
	},
	series: [{
	name: '2016 total killings by police in Kenya, by County',
	dataLabels: {
	//enabled: true,
	format: "{point.y:,.0f}",
	style: {
	//color: 'red',
	fontSize:'14px'
	},
	},
	color: "#ee2e2a",
	data: [
	<?php
	$servername = "localhost";
	$dbuser = "plexusrs";
	$dbpass = "sTUmTaQsSsPtRJy";
	$dbname = "newsplex_db";
	try {
	$conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbuser, $dbpass);
	// set the PDO error mode to exception
	$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$year2016='2016';
	//group by gender
	$sthandler = $conn->prepare("select county,killed from police_killings_per_county2016 where killed !='0' order by killed desc");
	$sthandler->bindParam(':year2016', $year2016);
	$sthandler->execute();
	$county = $sthandler->fetchAll();
	foreach ($county as $row) {
	echo $row['killed'].",";
	}
	}
	catch(PDOException $e)
	{
	echo "error" . "<br>" . $e->getMessage();
	}
	$conn = null;

	?>
	]

	}]
	});
	});
	</script>
	<head>
	<body>
	<div id="total_killings" style="min-width: 310px; height: 800px; margin: 0 auto"></div>
	<script src="http://code.highcharts.com/stock/highstock.js"></script>
	<script src="http://code.highcharts.com/highcharts-more.js"></script>
	<script src="http://code.highcharts.com/modules/exporting.js"></script>
	</body>
	</html>