Просмотр исходного кода

Round values to one decimal place

Alan Lam 4 лет назад
Родитель
Сommit
56c4938bc4
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      engine/chart_generator.php

+ 2 - 2
engine/chart_generator.php

@@ -97,7 +97,7 @@ class ChartGenerator {
 		]);
 		$chart->addYAxis([
 			"id" => "y-axis-1",
-		//	"tick_config" => ["min" => 0, "max" => 100],
+			"tick_config" => ["min" => 0, "max" => 100],
 			"stacked" => true,
 		]);
 
@@ -106,7 +106,7 @@ class ChartGenerator {
 				$total_count = array_sum($d["stageCounts"]);
 				if($total_count === 0) return 0;
 
-				return round(($d["stageCounts"][$stage_index] / $total_count) * 100);
+				return round(($d["stageCounts"][$stage_index] / $total_count) * 100, 1);
 			}, $venue_type_data));
 		};