diff --git a/app/Http/Controllers/APIS/CustomerApi/TelemetryController.php b/app/Http/Controllers/APIS/CustomerApi/TelemetryController.php index fe52ba0..63b54e0 100644 --- a/app/Http/Controllers/APIS/CustomerApi/TelemetryController.php +++ b/app/Http/Controllers/APIS/CustomerApi/TelemetryController.php @@ -1485,11 +1485,11 @@ class TelemetryController extends Controller $getLimit = Device::where('id', $deviceId)->select('speed_limit','torque_limit','power_limit')->first(); $graph1['y1'] = count($key1) === 3 ? ['name' => [$x1[0]['display_name'], $x1[1]['display_name']], 'min' => $min1, 'max' => $getLimit['torque_limit'] ?? 50000] : ['name' => [$x1['display_name']], 'min' => $min1, 'max' => $max1 ]; - $graph1['y2'] = $x2 ? ['name' => [$x2['display_name']], 'min' => 0, 'max' => $getLimit['speed_limit'] ?? 50000] : null; + $graph1['y2'] = $x2 ? ['name' => [$x2['display_name']], 'min' => 0, 'max' => ($key1[0] === 'StaticTorque_value') ? ($getLimit['speed_limit'] ?? $max1) : $max1] : null; $graph1[$date] = $value1; $graph2['y1'] = count($key2) === 3 ? ['name' => [$y1[0]['display_name'], $y1[1]['display_name']], 'min' => $min2, 'max' => $getLimit['power_limit'] ?? 500000] : ['name' => [$y1['display_name']], 'min' => $min2, 'max' => $max2 ]; - $graph2['y2'] = $y2 ? ['name' => [$y2['display_name']], 'min' => 0, 'max' => $getLimit['speed_limit'] ?? 50000] : null; + $graph2['y2'] = $y2 ? ['name' => [$y2['display_name']], 'min' => 0, 'max' => ($key2[0] === 'StaticPower_value') ? ($getLimit['speed_limit'] ?? $max2) : $max2] : null; $graph2[$date] = $value2; }