修改了环境监测数据的显示方式,在绘图时添加了类型、缩放级别两个参数

This commit is contained in:
Li Jianxuan 2012-06-25 09:19:23 +00:00
parent 830da7dc2c
commit ccbb0ee2ef
2 changed files with 35 additions and 6 deletions

View File

@ -518,7 +518,8 @@ class VisualController extends Zend_Controller_Action
$datas = array();
$label = "";
$title = "";
$range = 0;
$type = "line";
if($base == "meteorology")
{
@ -527,6 +528,7 @@ class VisualController extends Zend_Controller_Action
$title = "日平均温度";
$label = "";
$type = "line";
$datas = $this->getMeteorologyDataByStationId($ac,$label);
@ -537,6 +539,7 @@ class VisualController extends Zend_Controller_Action
$title = "日平均风速";
$label = "m/s";
$type = "line";
$datas = $this->getMeteorologyDataByStationId($ac,$label);
@ -547,6 +550,7 @@ class VisualController extends Zend_Controller_Action
$title = "日合计降水量";
$label = "mm";
$type = "line";
$datas = $this->getMeteorologyDataByStationId($ac,$label);
@ -557,6 +561,7 @@ class VisualController extends Zend_Controller_Action
$title = "日照小时数";
$label = "h";
$type = "line";
$datas = $this->getMeteorologyDataByStationId($ac,$label);
@ -571,6 +576,7 @@ class VisualController extends Zend_Controller_Action
{
$title = "日降水量";
$label = "mm";
$type = "line";
$datas = $this->getHydrologyDataByStationId($ac,$label);
@ -580,6 +586,7 @@ class VisualController extends Zend_Controller_Action
{
$title = "月均降水";
$label = "mm";
$type = "line";
$datas = $this->getHydrologyDataByStationId($ac,$label);
}//月均降水
@ -588,6 +595,7 @@ class VisualController extends Zend_Controller_Action
{
$title = "年均降水";
$label = "mm";
$type = "line";
$datas = $this->getHydrologyDataByStationId($ac,$label);
}//年均降水
@ -596,6 +604,7 @@ class VisualController extends Zend_Controller_Action
{
$title = "日均流量";
$label = "mm";
$type = "line";
$datas = $this->getHydrologyDataByStationId($ac,$label);
}
@ -604,6 +613,7 @@ class VisualController extends Zend_Controller_Action
{
$title = "月均流量";
$label = "mm";
$type = "line";
$datas = $this->getHydrologyDataByStationId($ac,$label);
}
@ -612,6 +622,7 @@ class VisualController extends Zend_Controller_Action
{
$title = "年均流量";
$label = "mm";
$type = "line";
$datas = $this->getHydrologyDataByStationId($ac,$label);
}
@ -626,6 +637,8 @@ class VisualController extends Zend_Controller_Action
{
$title = "总悬浮颗粒物";
$label="";
$type = "column";
$range = 6;
$datas = $this->getAmbientDataByStationId($ac,$label);
}
@ -633,6 +646,8 @@ class VisualController extends Zend_Controller_Action
{
$title = "可吸入颗粒物";
$label="";
$type = "column";
$range = 6;
$datas = $this->getAmbientDataByStationId($ac,$label);
}
@ -640,6 +655,8 @@ class VisualController extends Zend_Controller_Action
{
$title = "二氧化硫";
$label="";
$type = "column";
$range = 6;
$datas = $this->getAmbientDataByStationId($ac,$label);
}
@ -647,15 +664,22 @@ class VisualController extends Zend_Controller_Action
{
$title = "二氧化氮";
$label="";
$type = "column";
$range = 6;
$datas = $this->getAmbientDataByStationId($ac,$label);
}
}//环境监测数据
if(empty($range))
{
$range = 0;
}
$data = array(
"label"=>$label,
"title"=>$title,
"type"=>$type,
"range"=>$range,
"datas"=>$datas
);

View File

@ -63,16 +63,21 @@ $this->breadcrumb()->setSeparator(' > ');
</div>
<!-- //页面内容 -->
<script>
function drawchart(data,title) {
function drawchart(type,range,data,title) {
// Create the chart
window.chart = new Highcharts.StockChart({
'chart' : {
'renderTo' : 'datachart'
'renderTo' : 'datachart',
'type': type
},
'rangeSelector' :{
'enabled' : true,
'selected' : 0
'selected' : range
},
'credits':{
'enabled': false
},
'exporting': {
@ -121,7 +126,7 @@ $(".fetchSeries").click(function () {
{$('.fetchSeries').removeClass('btn-green');Alert('未请求到数据');return false;}
if(typeof(series.error)!='undefined')
{$('.fetchSeries').removeClass('btn-green');Alert(series.error);return false;}
drawchart(series.datas,series.title);
drawchart(series.type,series.range,series.datas,series.title);
}
$.ajax({