Új hozzászólás Aktív témák
-
wmati
addikt
válasz
Sk8erPeter
#17317
üzenetére
Itt utolsó sorban chart = new Highcharts.Chart(options); van ezzel nekem is pont ilyen de ha át írom chart = new Highcharts.StockChart(options); akkor nem értem hogy dátumot hogy lehetne jól meg jeleníteni.
-
wmati
addikt
válasz
Sk8erPeter
#17314
üzenetére
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Power levels</title>
<link rel="stylesheet" type="text/css" href="./css/temperature.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var options = {
chart: {
renderTo: 'container',
type: 'spline',
marginRight: 0,
marginBottom: 150,
zoomType: 'x'
},
title: {
text: 'Telekom Power levels (vargalex)',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: []
},
yAxis: {
title: {
text: 'Power level (dBmV)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: "dBmV"
/*formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y;
}*/
},
legend: {
enabled: true
},
series: []
}
$.getJSON("data.php", function(json) {
options.xAxis.categories = json[0]['data'];
options.xAxis.step = 6;
options.series[0] = json[1];
options.series[1] = json[2];
options.series[2] = json[3];
options.series[3] = json[4];
options.series[4] = json[5];
options.series[5] = json[6];
options.series[6] = json[7];
options.series[7] = json[8];
options.series[8] = json[9];
options.series[9] = json[10];
options.series[10] = json[11];
options.series[11] = json[12];
chart = new Highcharts.Chart(options);
});
});
</script>
</head>
<body>
<div id="container" style="min-width: 500px; height: 600px; margin: 0 auto"></div>
</body>
</html> -
wmati
addikt
válasz
Sk8erPeter
#17312
üzenetére
Ha jó sor rendben hányom össze működni is fog
[
{
"name": "D\u00e1tum",
"data": [
"2015-04-15 07:06.03"
]
},
{
"name": "Downstream channel 1",
"data": [
3.5
]
},
{
"name": "Downstream channel 2",
"data": [
3.5
]
},
{
"name": "Downstream channel 3",
"data": [
2.8
]
},
{
"name": "Downstream channel 4",
"data": [
1.2
]
},
{
"name": "Downstream channel 5",
"data": [
0.3
]
},
{
"name": "Downstream channel 6",
"data": [
0.3
]
},
{
"name": "Downstream channel 7",
"data": [
0.3
]
},
{
"name": "Downstream channel 8",
"data": [
0.3
]
},
{
"name": "Upstream channel 1",
"data": [
44
]
},
{
"name": "Upstream channel 2",
"data": [
44.4
]
},
{
"name": "Upstream channel 3",
"data": [
45.4
]
},
{
"name": "Upstream channel 4",
"data": [
0
]
}
] -
wmati
addikt
válasz
Sk8erPeter
#17310
üzenetére
Van egy data.php azzal be csatlakozol sql szerverre ahonnan ki kérem adatok és átadom a Highstock- nak ahol pedig idő pontok helyén 00:00:00:001 ilyenek jelennek meg de Highcharts-al viszont minden rendben van, idő adatokat pedig linuxos gép teszi meg datatime sql oszlopba.
<?php
require_once('config.inc.php');
$sql = "select date_format(datum,'%Y-%m-%d %H:%i.%s') as utime, down_ch1, down_ch2, down_ch3, down_ch4, down_ch5, down_ch6, down_ch7, down_ch8, up_ch1, up_ch2, up_ch3, up_ch4
from power_levels
where id between '1' and '40'
order by id
limit 0,5000";
//where datum between '".date("Y-m-d H:i.s")."' and '".date("Y-m-d H:i.s",time()+24*60*60)."'
$result = $mysqli->query($sql) or die($mysqli->error);
$dates=array();
$down_ch1=array();
$down_ch2=array();
$down_ch3=array();
$down_ch4=array();
$down_ch5=array();
$down_ch6=array();
$down_ch7=array();
$down_ch8=array();
$up_ch1=array();
$up_ch2=array();
$up_ch3=array();
$up_ch4=array();
$dates['name']='Dátum';
$down_ch1['name']='Downstream channel 1';
$down_ch2['name']='Downstream channel 2';
$down_ch3['name']='Downstream channel 3';
$down_ch4['name']='Downstream channel 4';
$down_ch5['name']='Downstream channel 5';
$down_ch6['name']='Downstream channel 6';
$down_ch7['name']='Downstream channel 7';
$down_ch8['name']='Downstream channel 8';
$up_ch1['name']='Upstream channel 1';
$up_ch2['name']='Upstream channel 2';
$up_ch3['name']='Upstream channel 3';
$up_ch4['name']='Upstream channel 4';
$recordcount = 0;
while ($row = $result->fetch_assoc()) {
$dates['data'][]=$row['utime'];
$down_ch1['data'][]=$row['down_ch1'];
$down_ch2['data'][]=$row['down_ch2'];
$down_ch3['data'][]=$row['down_ch3'];
$down_ch4['data'][]=$row['down_ch4'];
$down_ch5['data'][]=$row['down_ch5'];
$down_ch6['data'][]=$row['down_ch6'];
$down_ch7['data'][]=$row['down_ch7'];
$down_ch8['data'][]=$row['down_ch8'];
$up_ch1['data'][]=$row['up_ch1'];
$up_ch2['data'][]=$row['up_ch2'];
$up_ch3['data'][]=$row['up_ch3'];
$up_ch4['data'][]=$row['up_ch4'];
$recordcount++;
}
$mysqli->close();
$datas=array();
$datas[]=$dates;
$datas[]=$down_ch1;
$datas[]=$down_ch2;
$datas[]=$down_ch3;
$datas[]=$down_ch4;
$datas[]=$down_ch5;
$datas[]=$down_ch6;
$datas[]=$down_ch7;
$datas[]=$down_ch8;
$datas[]=$up_ch1;
$datas[]=$up_ch2;
$datas[]=$up_ch3;
$datas[]=$up_ch4;
header('Content-Type: text/javascript');
echo json_encode($datas, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT );
?> -
wmati
addikt
Új hozzászólás Aktív témák
- Gaming PC GTX 1660 Ti / 16GB RAM Azonnal vihető (CSGO,LOL,VALORANT,FORTNITE)
- SAMSUNG 4TB 990 EVO PLUS M.2 NVME PCI-E 4.0 x4/ 5.0 X2 - Új - 7250-6300 MBs - Eladó!
- Dell XPS 13 Plus 9320 i7-1260P 32GB 512GB 4K+ TouchScreen 1 év garancia
- SAMSUNG 2TB 990 PRO M.2 NVME PCI-E 4.0 - Új, 1 év garancia - 7450-6900 MBs - Eladó!
- LG Gram 16 i7-1165G7 / 16GB RAM / 512GB SSD / 2.5K kijelző
- GYÖNYÖRŰ iPhone 14 Pro Max 256GB Space Black-1 ÉV GARANCIA - Kártyafüggetlen, MS4143
- ÁRGARANCIA!Épített KomPhone Ryzen 7 9700X 32/64GB RAM RTX 5070 12GB GAMER PC termékbeszámítással
- ÁRGARANCIA!Épített KomPhone Ryzen 7 5700X 16/32/64GB RAM RTX 5060 Ti 16GB GAMER termékbeszámítással
- ÚJ Lenovo LOQ 15AHP10 - 15.6"FHD 144Hz - Ryzen 7 250 - 16GB 1TB - Win11 - RTX 5060 - 3 év gari
- HIBÁTLAN iPhone 14 Pro Max 512GB Silver -1 ÉV GARANCIA - Kártyafüggetlen
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
