increase type of output graphs.

This commit is contained in:
2021-10-28 14:42:00 +09:00
parent 3674880f07
commit d79f1aa172
2 changed files with 17 additions and 7 deletions

View File

@ -16,7 +16,16 @@ for ($i = 0; $i < $num; ++$i) {
$now = time();
$rrdtemp->update($id, $now, $value);
}
foreach ($types = ['hour', 'day', 'week', 'month', 'year', '3year'] as $type) {
$fpath = APPDIR.'/'.$config['images_dir'].'/graph-'.$type.'.png';
$rrdtemp->outputGraph($type, $fpath);
$types = [
'hour' => [1, 3, 6, 12],
'day' => [1, 3],
'week' => [1, 2],
'month' => [1, 3, 6],
'year' => [1, 3, 5, 10],
];
foreach ($types as $type => $nums) {
foreach ($nums as $num) {
$fpath = APPDIR.'/'.$config['images_dir'].'/graph-'.(1 === $num ? '' : $num).$type.'.png';
$rrdtemp->outputGraph($type, $num, $fpath);
}
}