fixed mixed days in month-view

master
agp8x 2015-09-02 11:57:52 +02:00
parent bb0bfa4818
commit f5e186ceae
3 changed files with 9 additions and 9 deletions

View File

@ -1 +1 @@
57336de 718552a

View File

@ -65,8 +65,8 @@ function generateChart($today,$mode,$hours=0,$dateInput){
} }
}else{ }else{
$where=array('year'=>$year,'month'=>$month); $where=array('year'=>$year,'month'=>$month);
$db->toggleDevmode(); //$db->toggleDevmode();
$summary=$db->select('summary','*',$where); $summary=$db->select('summary','*',$where,"ORDER BY day");
if($summary===false){ if($summary===false){
$html.="No values (".$type.")"; $html.="No values (".$type.")";
return; return;
@ -273,14 +273,11 @@ function generateChart($today,$mode,$hours=0,$dateInput){
$selectionStart+=3600; $selectionStart+=3600;
//} //}
} }
if($mode==3){
//$selectionEnd-=2*60*60*24;
}
$labels=getLabels($datas[0],$selectionStart,$selectionEnd,$chartdistance); $labels=getLabels($datas[0],$selectionStart,$selectionEnd,$chartdistance);
if($mode==3){ if($mode==3){
$selectionStart+=60*60*24; $selectionStart+=60*60*24;
$selectionEnd+=60*60*24; $selectionEnd+=60*60*24;
$div=1; $div=0;
} }
foreach($datas as $key=>$dataset){ foreach($datas as $key=>$dataset){
#file_put_contents('data'.$type.($key+1),var_export($dataset,true)); #file_put_contents('data'.$type.($key+1),var_export($dataset,true));
@ -290,7 +287,6 @@ function generateChart($today,$mode,$hours=0,$dateInput){
#file_put_contents('val'.$type.($key+1),var_export($values,true)); #file_put_contents('val'.$type.($key+1),var_export($values,true));
} }
#file_put_contents('labels',var_export($labels,true));
$myData->addPoints($labels,"Labels"); $myData->addPoints($labels,"Labels");
#file_put_contents('label',var_export($labels,true)); #file_put_contents('label',var_export($labels,true));
$myData->setAxisName(0,typeToFullName($type).getUnit($type)); $myData->setAxisName(0,typeToFullName($type).getUnit($type));

View File

@ -251,7 +251,11 @@ function prepareData($data,$div,$start=0,$end=0,$chartdistance=60){
$values=array(); $values=array();
$rawdata=outlinedLogPoints($data,$chartdistance,$start,$end); $rawdata=outlinedLogPoints($data,$chartdistance,$start,$end);
foreach($rawdata as $set){ foreach($rawdata as $set){
$values[]=round($set[0]/$div,1); if($div==0){
$values[]=$set[0];
}else{
$values[]=round($set[0]/$div,1);
}
} }
return $values; return $values;
} }