diff --git a/database/seeders/BrandStatSeeder.php b/database/seeders/BrandStatSeeder.php index e32c31a..fcdc570 100644 --- a/database/seeders/BrandStatSeeder.php +++ b/database/seeders/BrandStatSeeder.php @@ -23,19 +23,21 @@ class BrandStatSeeder extends Seeder foreach ($brands as $brand) { $startDay = Carbon::now(); $total = rand(100, 99999); - $active = rand(10, 89) / 100; - $new = rand(10, 89) / 100; + $active = rand(2, 20) / 100; + $new = rand(10, 30) / 100; for ($i = 730; $i > 0; $i--) { $total += floor($i / 2); // pourcentage active - $pActive = $active * ((731 - $i) * 100 / 730); + $pActive = $active + ((731 - $i + 150) * 100 / 730) / 100; + $pInactive = 1 - $pActive; // pourcentage nouveau - $pNew = $new * ($i * 100 / 730); + $pNew = $new; + $pOld = 1 - $pNew; $brandStat = new BrandStat([ 'active' => \floor($total * $pActive), - 'inactive' => \ceil($total * $pActive), - 'old_accounts' => \ceil($total * $pNew), + 'inactive' => \ceil($total * $pInactive), + 'old_accounts' => \ceil($total * $pOld), 'new_accounts' => \floor($total * $pNew), 'total_accounts' => $total, 'total_opt_in' => ceil($total * 0.15) // 15% optin diff --git a/resources/views/stats/view-stats-by-brands.blade.php b/resources/views/stats/view-stats-by-brands.blade.php index 2e7cb4c..da7d8ee 100644 --- a/resources/views/stats/view-stats-by-brands.blade.php +++ b/resources/views/stats/view-stats-by-brands.blade.php @@ -193,7 +193,7 @@ document.addEventListener("DOMContentLoaded", function(event) { }, y: { display: true, - beginAtZero: true, + beginAtZero: false, type: 'logarithmic' } },