Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Projet SAÉ 303
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GONZALEZ LORENZO Aldo
Projet SAÉ 303
Commits
8655021f
Commit
8655021f
authored
2 years ago
by
Aldo Gonzalez-Lorenzo
Browse files
Options
Downloads
Patches
Plain Diff
Remove old file
parent
bb92490a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test-charts.php
+0
-86
0 additions, 86 deletions
test-charts.php
with
0 additions
and
86 deletions
test-charts.php
deleted
100644 → 0
+
0
−
86
View file @
bb92490a
<!DOCTYPE html>
<html
lang=
"fr"
>
<head>
<meta
charset=
"utf-8"
>
<title>
SAÉ 303
</title>
</head>
<body>
<div
id=
"piechart_div"
></div>
<div
id=
"barchart_div"
></div>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js"
></script>
<script
src=
"https://www.gstatic.com/charts/loader.js"
></script>
<script>
const
httpRequest
=
new
XMLHttpRequest
();
httpRequest
.
onreadystatechange
=
()
=>
{
if
(
httpRequest
.
readyState
===
XMLHttpRequest
.
DONE
)
{
if
(
httpRequest
.
status
===
200
)
{
console
.
debug
(
result
)
const
response
=
JSON
.
parse
(
httpRequest
.
responseText
);
console
.
debug
(
result
)
google
.
charts
.
load
(
"
current
"
,
{
"
packages
"
:
[
"
corechart
"
],
"
language
"
:
"
fr
"
})
google
.
charts
.
setOnLoadCallback
(
function
()
{
drawChart
(
response
)
})
}
else
{
// There was a problem with the request.
// For example, the response may have a 404 (Not Found)
// or 500 (Internal Server Error) response code.
}
}
else
{
// Not ready yet.
}
};
httpRequest
.
open
(
'
GET
'
,
'
include/php/data.php
'
,
true
);
query
=
"
SELECT acad_mies, sum(capa_fin) AS places FROM parcoursup GROUP BY acad_mies ORDER BY places DESC
"
httpRequest
.
send
(
`query=
${
encodeURIComponent
(
query
)}
`
);
// $(document).ready(function() {
// $.ajax({
// url: "include/php/data.php",
// method: "GET",
// data: {
// "query": "SELECT acad_mies, sum(capa_fin) AS places FROM parcoursup GROUP BY acad_mies ORDER BY places DESC"
// },
// dataType: "JSON",
// success: function(result) {
// console.debug(result)
// google.charts.load("current", { "packages": ["corechart"], "language": "fr" })
// google.charts.setOnLoadCallback(function() {
// drawChart(result)
// })
// }
// })
// function drawChart(result) {
// let data = new google.visualization.DataTable()
// data.addColumn('string', 'Académie')
// data.addColumn('number', 'Places')
// let dataArray = []
// for (const item of result) {
// dataArray.push([item.acad_mies, Number(item.places)])
// }
// data.addRows(dataArray)
// let piechart_options = {
// title: 'Pie Chart : Nombre de places dans chaque académie',
// width: 600,
// height: 400
// }
// let piechart = new google.visualization.PieChart(document.getElementById('piechart_div'))
// piechart.draw(data, piechart_options)
// let barchart_options = {
// title: 'Barchart : Nombre de places dans chaque académie',
// width: 600,
// height: 800,
// legend: 'none'
// }
// let barchart = new google.visualization.BarChart(document.getElementById('barchart_div'))
// barchart.draw(data, barchart_options)
// }
// })
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment