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

View File

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