From 7eb50adf8f1a87e7dbb5147c183fcf2987f80bc9 Mon Sep 17 00:00:00 2001 From: xin Date: Fri, 25 Feb 2022 18:01:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BD=8D=E7=BD=AE=E6=9B=B2?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/config/LocationCali.php | 30 ++++++++++++++++++++++++++++- html/config/js/printercaliresult.js | 30 +++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 html/config/js/printercaliresult.js diff --git a/html/config/LocationCali.php b/html/config/LocationCali.php index 390dc85..42cdaa7 100644 --- a/html/config/LocationCali.php +++ b/html/config/LocationCali.php @@ -1,5 +1,10 @@ "; echo "finish"; -echo '回到首页'; \ No newline at end of file + +echo '回到首页'; + +$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 '
'; + +echo ' '; +echo ''; +echo ''; \ No newline at end of file diff --git a/html/config/js/printercaliresult.js b/html/config/js/printercaliresult.js new file mode 100644 index 0000000..70a2dfc --- /dev/null +++ b/html/config/js/printercaliresult.js @@ -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); \ No newline at end of file