<?php 
include_once"config.php";
$e = mysqli_query($con, "select * from emirate where status = 1 order by name");
$query = mysqli_query($con,"select *  from custome_page  where id = 5");
$d = mysqli_fetch_array($query);
$chart_title = isset($d['chart_title'])?$d['chart_title']:null;
?>
<script>
window.onload = function () {

var options = {
	animationEnabled: true,
	title: {
		text: "<?= $chart_title;?>"
	},
	axisY: {
		title: "Growth Rate (in %)",
		suffix: "%",
		includeZero: false
	},
	axisX: {
		title: ""
	},
	data: [{
		type: "column",
		yValueFormatString: "#,##0.0#"%"",
		dataPoints: [
		<?php while($em = mysqli_fetch_array($e)){ ?>
		
			{ label: "<?= $em['name'] .' ('.$em['value'].')'; ?>", y: <?= $em['percent'];?> },
<?php } ?>			
			
			
		]
	}]
};
$("#chartContainer").CanvasJSChart(options);

}
</script>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script>
<script src="https://canvasjs.com/assets/script/jquery.canvasjs.min.js"></script>