Преглед изворни кода

Round values to one decimal place

Alan Lam пре 4 година
родитељ
комит
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([
 		$chart->addYAxis([
 			"id" => "y-axis-1",
 			"id" => "y-axis-1",
-		//	"tick_config" => ["min" => 0, "max" => 100],
+			"tick_config" => ["min" => 0, "max" => 100],
 			"stacked" => true,
 			"stacked" => true,
 		]);
 		]);
 
 
@@ -106,7 +106,7 @@ class ChartGenerator {
 				$total_count = array_sum($d["stageCounts"]);
 				$total_count = array_sum($d["stageCounts"]);
 				if($total_count === 0) return 0;
 				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));
 			}, $venue_type_data));
 		};
 		};