</script>
</script>
<script type = "text/javascript">
google.charts.load('current', {packages: ['corechart']});
</script>
</head>
<div id = "container" style = "width: 550px; height: 400px; margin: 0 auto">
</div>
<script language = "JavaScript">
function drawChart() {
var data = google.visualization.arrayToDataTable([
['month', 'Performance Indicator (%)'],
<?php
$username=$_GET['username'];
$query = "SELECT month , result_ind, target, username FROM performance WHERE username = $username";
$exec = mysqli_query($db,$query);
while($row = mysqli_fetch_assoc($exec)){
echo "[".$row['month'].",".$row['result_ind']."],";
}
?>
]);
// Set chart options
var options = {
'title':'Month vs Performance Indicator for 2020',
vAxis: {
title: '%',
baseline: 2.00,
baselineColor: 'red'
},
hAxis: {
title: 'Month'
},
'width':550,
'height':400,
pointSize: 5,
trendlines: {
0: {
type: 'linear',
color: 'purple',
lineWidth: 5,
opacity: 0.2,
//visibleInLegend: true,
}
}
};
// Instantiate and draw the chart.
var chart = new google.visualization.LineChart(document.getElementById('container'));
chart.draw(data, options);
}
google.charts.setOnLoadCallback(drawChart);
</script>