Witam mam problem z wykresem mianowicie chciałbym w pliku strona.php wygenerować 2 wykresy graficzne highcharts.
Gdy dodam 1 wykres jest wszystko wporządku ale gdy dodam drugi taki sam to już sie ten drugi wykres nie wyswietli
tak wyglada kod php pliku strona.php
<center>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script src="/staty.css"></script>
<script>
$(function () {
$('#container').highcharts({
title: {
text: 'Statystyki z ostatnich 24h',
x: -20 //center
},
subtitle: {
text: 'Lista serwerów',
x: -20
},
xAxis: {
categories: [
<?php
$wynik= mysql_query("SELECT * FROM statystyki_serwerow ORDER BY czas DESC LIMIT 24"); echo "'".$r_gracze['godzina'].":00', "; }?>
]
},
yAxis: {
title: {
text: 'Liczba'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: ''
},
legend: {
layout: 'vertical',
align: 'center',
verticalAlign: 'bottom',
borderWidth: 1
},
series: [{
name: 'graczy online',
data: [
<?php
$wynik= mysql_query("SELECT * FROM statystyki_serwerow WHERE ip='".$_GET['ip']."' ORDER BY czas DESC LIMIT 24"); echo "".$r_gracze['graczy'].", "; }
?>
]
}]
});
});
</script>
<div id="container" style="min-width: 310px; height: 250px; margin: 0 auto"></div>
</center>
<center>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script src="/staty.css"></script>
<script>
$(function () {
$('#container').highcharts({
title: {
text: 'Statystyki z ostatnich 24h',
x: -20 //center
},
subtitle: {
text: 'Lista serwerów',
x: -20
},
xAxis: {
categories: [
<?php
$wynik= mysql_query("SELECT * FROM statystyki_serwerow ORDER BY czas DESC LIMIT 24"); echo "'".$r_gracze['godzina'].":00', "; }?>
]
},
yAxis: {
title: {
text: 'Liczba'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: ''
},
legend: {
layout: 'vertical',
align: 'center',
verticalAlign: 'bottom',
borderWidth: 1
},
series: [{
name: 'graczy online',
data: [
<?php
$wynik= mysql_query("SELECT * FROM statystyki_serwerow WHERE ip='".$_GET['ip']."' ORDER BY czas DESC LIMIT 24"); echo "".$r_gracze['graczy'].", "; }
?>
]
}]
});
});
</script>
<div id="container" style="min-width: 310px; height: 250px; margin: 0 auto"></div>
</center>
Ten post edytował csharnas 21.05.2014, 09:53:46