Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $.ajax({
- url: "./getdatas.php",
- context: document.body
- }).done(function(retour) {
- retour = $.parseJSON(retour);
- var values = [];
- var datestimes = [];
- retour.forEach(function (val) {
- values.push (val.temp);
- datestimes.push(val.datatime);
- });
- //$ appel jquery #jqchart id dans l'html .jqchart() : bibliothèque
- $('#jqChart').jqChart({
- title: { text: 'Spline Chart' },
- tooltips: { type: 'shared' },
- animation: { duration: 1 },
- axes: [
- {
- type: 'category',
- location: 'bottom',
- categories: datestimes
- }
- ],
- series: [
- {
- type: 'spline',
- title: 'Valeurs',
- data: values,
- strokeDashArray: [0,3]
- },
- ]
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement