php側
$temp_max = max($temp) + 0.5; if(min($temp) > 0 ){ $temp_min = 0; } else { $temp_min = min($temp) - 0.5; }
JS側
ticks: { max: <?php echo $temp_max; ?>, min: <?php echo $temp_min; ?>, stepSize: 2.0 }
最高気温の方も必要でした(モスクワ笑)
if(max($temp) < 0 ){ $temp_max = 0; } else { $temp_max = max($temp) + 0.5; } if(min($temp) > 0 ){ $temp_min = 0; } else { $temp_min = min($temp) - 0.5; }