mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 03:49:42 +08:00
显示位置曲线
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
<?php
|
||||
//var_dump($_GET);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$sensor=$_GET['sensor'];
|
||||
$number=$_GET['positionnumber'];
|
||||
$shuter=$_GET['shutterTime'];
|
||||
@ -28,4 +33,27 @@ while(!feof($proc)){
|
||||
}
|
||||
echo "<br>";
|
||||
echo "finish";
|
||||
echo '<a href=/config/position.html>回到首页</a>';
|
||||
|
||||
echo '<a href=/config/position.html>回到首页</a>';
|
||||
|
||||
$file=fopen('/home/data/test.csv','r');
|
||||
|
||||
while ($data = fgetcsv($file)) { //每次读取CSV里面的一行内容
|
||||
//print_r($data); //此为一个数组,要获得每一个数据,访问数组下标即可
|
||||
$goods_list[] = $data;
|
||||
}
|
||||
|
||||
var_dump($goods_list[0]);
|
||||
$hang=count($goods_list);
|
||||
$x=$goods_list[0][2];
|
||||
$y=$goods_list[0][1];;
|
||||
for($i=1;$i<$hang;$i++)
|
||||
{
|
||||
$x=$x.','.$goods_list[$i][2];
|
||||
$y=$y.','.$goods_list[$i][1];
|
||||
}
|
||||
echo '<div id="main" style="width: 600px;height:400px;"></div> ';
|
||||
|
||||
echo ' <script src="config/js/echarts.js"></script>';
|
||||
echo '<script>var xx=['.$x.']; var yy=['.$y.']; </script>';
|
||||
echo '<script src="config/js/printercaliresult.js"></script>';
|
30
html/config/js/printercaliresult.js
Normal file
30
html/config/js/printercaliresult.js
Normal file
@ -0,0 +1,30 @@
|
||||
var chartDom = document.getElementById('main');
|
||||
var myChart = echarts.init(chartDom);
|
||||
// 指定图表的配置项和数据
|
||||
var option = {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [1,2,3,4,5,6]
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
tooltip:{
|
||||
trigger:'axis'
|
||||
},
|
||||
dataZoom:[{
|
||||
type:"inside" //详细配置可见echarts官网
|
||||
}],
|
||||
series: [
|
||||
{
|
||||
name: 'DN',
|
||||
data: [150, 230, 224, 218, 135, 147, 260],
|
||||
type: 'line'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option.xAxis.data=xx;
|
||||
option.series[0].data=yy;
|
||||
option
|
||||
myChart.setOption(option);
|
Reference in New Issue
Block a user