We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$("#diseaseselection").change(function(){ $("#chart").empty(); var diseaseselection = $("#diseaseselection").val(); $.ajax({ url: "chart.php", method: "POST", data: { diseaseselection: diseaseselection }, success: function(data) { var graphdata = data; console.log(graphdata) Morris.Line({ element : 'chart', data:[graphdata], xkey:'totalF', ykeys:[ 'totalM'], labels:['Total MALE'], hideHover:'auto', pointStrokeColors: ['white'], lineWidth:'6px', parseTime: false, lineColors: ['Skyblue', 'Pink'], }); } }); });
The text was updated successfully, but these errors were encountered:
include_once('connection.php'); $diseaseselection = $_REQUEST['diseaseselection']; if(isset($diseaseselection)){ $result = mysqli_query($con, "SELECT disease,age,SUM(CASE WHEN gender = 'm' THEN 1 ELSE 0 END) AS `totalM`, SUM(CASE WHEN gender = 'f' THEN 1 ELSE 0 END) AS `totalF` FROM mdr where disease = '$diseaseselection' GROUP BY disease , age"); $chart_data = ''; while($row = mysqli_fetch_array($result)) { $tabx[]=$row['totalF']; $taby[]=$row['totalM']; } $tableau=array_combine($tabx,$taby); foreach($tableau as $key=>$value){ $string[]=array('totalF'=>$key,'totalM'=>$value); } echo json_encode($string); }
Here is my sample PHP
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: