[Highcharts] Afficher plusieurs lignes dans un graphe
Bonjour,
Je n'affiche qu une courbe correspondant au point 4
Si qq un à l'habitude ici de cette solution, j aimerais beaucoup qu il m explique comment afficher toutes les colonnes ...
Je crois que ca se passe dans series [] sans en etre certain
Merci
J'ai des données CSV de cette forme :
Code:
1 2 3 4 5 6 7 8 9 10 11
| date;time;point1;point2;point3;point4;point5;point6;point7
28-02-2011;23:53:00;7748;3135;7078;3781;11484;7613;955
28-03-2011;23:42:00;7748;3136;7078;3781;11484;7613;955
28-04-2011;23:30:00;7748;3137;7078;3781;11484;7613;955
28-05-2011;23:19:00;7748;3138;7078;3781;11484;7613;955
28-06-2011;23:08:00;7748;3139;7078;3781;11484;7613;955
28-07-2011;22:56:00;7748;3140;7078;3781;11484;7613;955
28-08-2011;22:45:00;7748;3141;7078;3781;11484;7613;955
28-09-2011;22:34:00;7748;3142;7078;3781;11484;7613;955
28-10-2011;22:22:00;7748;3143;7078;3781;11484;7613;955
28-11-2011;22:11:00;7748;3144;7078;3781;11484;7613;955 |
et le code suivant
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| <!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highstock Example</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$.get('classeur10.csv', function(csv, state, xhr) {
// inconsistency
if (typeof csv != 'string') {
csv = xhr.responseText;
}
// parse the CSV data
var data = [], header, comment = /^#/, x;
$.each(csv.split('\n'), function(i, line){
if (!comment.test(line)) {
if (!header) {
header = line;
}
else {
var point = line.split(';'),
date = point[0].split('-');
if (point.length > 1) {
x = Date.UTC(date[2], date[1] - 1, date[0]);
data.push([
x, // time
parseFloat(point[3])
// close
]);
}
}
}
});
// Create the chart
window.chart = new Highcharts.StockChart({
chart: {
renderTo: 'container'
},
rangeSelector: {
selected: 1
},
title: {
text: 'USD to EUR exchange rate'
},
xAxis: {
maxZoom: 14 * 24 * 3600000 // fourteen days
},
yAxis: {
title: {
text: 'Exchange rate'
}
},
series: [{
name: 'USD to EUR',
data: data,
marker: {
enabled: true,
radius: 3
},
shadow: true
}]
});
});
});
</script>
</head>
<body>
<script type="text/javascript" src="../../js/highstock.js"></script>
<div id="container" style="height: 500px"></div>
</body>
</html> |