Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
P
pima2018_25
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de conteneurs
Registre de modèles
Opération
Environnements
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Clément VEYSSIÈRE
pima2018_25
Validations
a01f09d9
Valider
a01f09d9
rédigé
Il y a 6 ans
par
ericwang
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
graph twitter
parent
203c2117
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
graphs/graphFunctions.php
+45
-3
45 ajouts, 3 suppressions
graphs/graphFunctions.php
page_user/user.php
+63
-5
63 ajouts, 5 suppressions
page_user/user.php
avec
108 ajouts
et
8 suppressions
graphs/graphFunctions.php
+
45
−
3
Voir le fichier @
a01f09d9
<?php
/* Include the `fusioncharts.php` file that contains functions to embed the charts. */
include
(
"fusioncharts-suite-xt/integrations/php/fusioncharts-wrapper/fusioncharts.php"
);
require_once
(
'../API_Twitter/userInfosFunctions.php'
);
/**
* Must have included the JS
*/
...
...
@@ -61,6 +61,48 @@ function lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $data, $wid
echo
'<center> <div id="'
.
$chartName
.
'">Chart will render here!</div> </center>'
;
}
function
diagramme
(
$favt
){
echo
'
<script type="text/javascript" src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script type="text/javascript" src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<script type="text/javascript">
FusionCharts.ready(function(){
var fusioncharts = new FusionCharts({
type: "bar2d",
renderAt: "diagtwitter",
width: "500",
height: "400",
dataFormat: "json",
dataSource: {
"chart": {
"theme": "fusion",
"caption": "Les meilleurs favoris",
"subCaption": "Twitter",
"yAxisName": "Nombre de followers",
"numberPrefix": "$",
"alignCaptionWithCanvas": "0"
},
"data": ['
;
for
(
$i
=
0
;
$i
<
count
(
$favt
)
-
2
;
$i
++
){
$name
=
getUserScreenName
(
$favt
[
$i
]);
$followers
=
getUserNbFollowers
(
$favt
[
$i
]);
echo
' {
"label": "'
.
$name
.
'",
"value": "'
.
$followers
.
'"
},'
;
}
$name
=
getUserScreenName
(
$favt
[
count
(
$favt
)
-
1
]);
$followers
=
getUserNbFollowers
(
$favt
[
count
(
$favt
)
-
1
]);
echo
'{
"label": "'
.
$name
.
'",
"value": "'
.
$followers
.
'"
}]
}
})});
fusioncharts.render();
</script>'
;
}
?>
Ce diff est replié.
Cliquez pour l'agrandir.
page_user/user.php
+
63
−
5
Voir le fichier @
a01f09d9
<?php
require_once
(
'../facto.php'
);
require_once
(
'../API_Twitter/userInfosFunctions.php'
);
require_once
(
'../graphs/graphFunctions.php'
);
session_start
();
ini_set
(
'display_errors'
,
1
);
ini_set
(
'display_startup_errors'
,
1
);
error_reporting
(
E_ALL
);
?>
<!DOCTYPE html>
<html
lang=
"zxx"
>
<html>
<?php
head
();
?>
...
...
@@ -23,12 +28,9 @@ session_start();
<div
class=
"slider-info bg1"
>
<div
class=
"w3l-overlay"
>
<div
class=
"banner-text text-center container"
>
<table
width=
"400"
class=
"hovertable"
align=
"center"
style=
'text-align:center;background: white'
border=
'1'
>
<tr
style=
"background: #3fcbfe;"
><th>
image
</th><th>
twitter
</th></tr>
<?php
session_start
();
<?php
// initializing variables
$username
=
$_SESSION
[
'username'
];
...
...
@@ -50,7 +52,63 @@ session_start();
$result
=
mysqli_query
(
$db
,
$fav
);
$fav
=
mysqli_fetch_assoc
(
$result
);
$favt
=
unserialize
(
$fav
[
'twitter'
]);
?>
<?php
echo
'<script type="text/javascript" src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script type="text/javascript" src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<script type="text/javascript">
FusionCharts.ready(function(){
var fusioncharts = new FusionCharts({
type: "bar2d",
renderAt: "diagtwitter",
width: "500",
height: "400",
dataFormat: "json",
dataSource: {
"chart": {
"theme": "fusion",
"caption": "Top 5 Stores by Sales",
"subCaption": "Last month",
"yAxisName": "Sales (In USD)",
"numberPrefix": "$",
"alignCaptionWithCanvas": "0"
},
"data": [{
"label": "Bakersfield Central",
"value": "880000"
}, '
;
for
(
$i
=
0
;
$i
<
min
(
10
,
count
(
$favt
)
-
2
)
;
$i
++
){
$name
=
getUserScreenName
(
$favt
[
$i
]);
$followers
=
getUserNbFollowers
(
$favt
[
$i
]);
echo
' {
"label": "'
.
$name
.
'",
"value": "'
.
$followers
.
'"
},'
;
}
$name
=
getUserScreenName
(
$favt
[
count
(
$favt
)
-
1
]);
$followers
=
getUserNbFollowers
(
$favt
[
count
(
$favt
)
-
1
]);
echo
'{
"label": "'
.
$name
.
'",
"value": "'
.
$followers
.
'"
}
]
}
});
fusioncharts.render();
});
</script>'
;
?>
<div
id=
"diagtwitter"
>
Le diagramme twitter s affiche ici !
</div>
<table
width=
"400"
class=
"hovertable"
align=
"center"
style=
'text-align:center;background: white'
border=
'1'
>
<tr
style=
"background: #3fcbfe;"
><th>
image
</th><th>
twitter
</th></tr>
<?php
$datarow
=
count
(
$favt
);
for
(
$i
=
0
;
$i
<
$datarow
;
$i
++
){
$twitter
=
getUserScreenName
(
$favt
[
$i
]);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter