Merci à nos donateurs:
M. Blanc
M. JavierMartinez
M. Viktor
M.
Emanuel Roggen
M. Raphaël
Chochon
M. José
Luis Sanchez
M. Daniel Stuyck
M. Jean-Pierre
Tonnele
M. Benoist Lerouge
M. Pierre Sabatier
M. Patrick Ollivier
M. Michel Le
Viol
M. César
López
M. Didier Mestric
M. Francesco
Paolo Trapani
M. Charles Durand
M.
Philippe Blanchard
M. Benjamin
Leblic
Philippe Dupertuys
M. Jaume Mas
Ferrer
M. Daniel Lavocat
M. Jean-Pierre
Bernard
M.Gérard Egger
M. Jean-Claude
Birade
M. Dominique
Herraire
M. Eric Lemoine
M. Jean Gabriel
Boulet
M. Olivier Bovel
M. Arnaud Rahier
M. Bruno Goyac
M. Jean Michel
Vouillot
M. Sarah Cordeau
M. Jean-Pierre
Grieu
M. Loic Roulin
M. Michel Beel
M. Dominique
Gautheron
M. Hubert Verwilghen
Picardie WebMarketing
M. Patrick Puydebois
M. Thierry Hauuy
M. Francis Mirante
Visiteurs depuis le 07.01.2010
Visites du jour :
Tutoriel MySQL
- Highcharts
the graph
We begin our famous chart?
Yes, we started installing the calls to bookstores,
which are java script. Also in the same file is added:
Change access depending on your site configuration and name that
you configured for file paths Highcharts
The jquerry.min.js script is required.
The highcharts.js script is required, this is the main script
of Highcharts library.
The grid.js script is optional, is what defines the overall graphs
of your chart, there are five predefined themes default Exemple.
Exemple
To change a theme, replace the line in the name of the js
file
OBVIOUSLY THERE IS NOTHING MORE THAN TO PUT A SUBJECT
If you choose to set a theme, you can still change the appearance
of the graph with Highcharts API.
Example: you put<script type="text/javascript"
src="../highcharts3/themes/dark-blue.js"></script>
and get the
Example: you put <script
type="text/javascript" src="../highcharts3/themes/dark-green.js"></script>
and get the
Example: you put<script
type="text/javascript" src="../highcharts3/themes/gray.js"></script>
and get the
The Exporting.js script is only for the
export icon located in the graphics on the top rights
Also in the same file, then insert the Highcharts
code, because as java script, you start with the js tag.
<script type="text/javascript">
Next, the function of (time) is set to the x axis
<script type="text/javascript">
function comArr(unitsArray) { var outarr = []; for (var i = 0; i < time.length; i++) { outarr[i] = [time[i], unitsArray[i]]; } return outarr; }
We define the general settings and the translation
<script type="text/javascript">
function comArr(unitsArray) { var outarr = []; for (var i = 0; i < time.length; i++) { outarr[i] = [time[i], unitsArray[i]]; } return outarr; }
$(function () { var chart; $(document).ready(function() { var highchartsOptions = Highcharts.setOptions(Highcharts.theme); Highcharts.setOptions({ lang: { months: ["Janvier "," Février "," Mars "," Avril "," Mai "," Juin "," Juillet "," Août ","
Septembre "," Octobre "," Novembre "," Décembre"], weekdays: ["Dim "," Lun "," Mar "," Mer "," Jeu "," Ven "," Sam"], shortMonths: ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil','Août', 'Sept', 'Oct
', 'Nov', 'Déc'], decimalPoint: ',', resetZoom: 'Reset zoom', resetZoomTitle: 'Reset zoom à 1:1', downloadPNG: "Télécharger au format PNG image", downloadJPEG: "Télécharger au format JPEG image", downloadPDF: "Télécharger au format PDF document", downloadSVG: "Télécharger au format SVG vector image", exportButtonTitle: "Exporter image ou document", printChart: "Imprimer le graphique", loading: "Chargement..." } });
You can change the text (translation) in green, do not touch
the rest of the code, will be the basis of all graphs. default language is English, you can suppromer these lines
As regards the time taken to do this
tutorial, I would appreciate you not modify this code.
if you use these scripts, not directly attributed authorship (putting
your name) or indirectly (without indicating the source).
We define the x axis
xAxis: { type: 'datetime', startOnTick: false, },
startOnTick = false ou true
we define the y axis
Option: plotlines set a line on the shaft and "value"
0 ° C in this example, with a width "width" of 1pxs
and red
The "Information Tool" is the legend that appears when
you put your mouse over a curve defined
tooltip: { crosshairs:[true], borderColor: '#4b85b7', shared: true, backgroundColor: '#edf1c8', formatter: function() { var s = '<b>'+ Highcharts.dateFormat('%e %B à %H:%M', this.x) +'</b>'; $.each(this.points, function(i, point) { var unit = { 'Dewpoin': ' °C', 'Température': ' °C', 'Windchill' : '', 'Humidex' : '' }[this.point.series.name]; s = s + '<br>' + '<span style="color:'+ point.series.color +'">' + point.series.name + '
</span> : ' +Highcharts.numberFormat(point.y,1,","," ") + unit; }); return s; }, },
The "crosshairs" is a line that shows the xy position
of the mouse on the chart ..
[true], = Only the axis x
[true, true], = x and y axis
[false], = no line
borderColor: '#4b85b7', = The border
color of tooltip
name: 'Température', = the
name you want to give your curve
zIndex: 1, = here I have put a zIndex
to indicate that the curve is in the foreground
color: '#ff0000', color = curve
data: comArr(outdoortemperature)
= and finally the name of the data to draw
Do the same for the other 3 data.
There is not only the keys and close
parentheses. We close the script tag and head
}); }); }); </script> </head>
Now there is more to display the graph in the body
"body" of the page and close the html tagl
id="container"
= This is the name you defined in the beginning "renderTo:
'container',"
style="width: 550px; height: 300px;
= The length and width you want to give your graph.
Attention, les données météo publiées
sur ce site sont issues d'une station météo personnelle
et ne sont données qu'à titre indicatif,
elles ne peuvent en aucun cas être utilisées pour garantir
la protection des personnes ou de biens quelconques.
Stations amies
MySQL - Highcharts page n°4
Highcharts, the graph.