diff --git a/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-sources.blade.php b/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-sources.blade.php index 01b1dbb1c..99e2d9540 100644 --- a/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-sources.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-sources.blade.php @@ -134,10 +134,20 @@ class="dark:mix-blend-exclusion dark:invert" .then(response => { this.report = response.data; + this.extendColors(this.report.statistics.length); + this.isLoading = false; }) .catch(error => {}); - } + }, + + extendColors(length) { + while (this.colors.length < length) { + const hue = Math.floor(Math.random() * 360); + const newColor = `hsl(${hue}, 70%, 60%)`; + this.colors.push(newColor); + } + }, } }); diff --git a/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-types.blade.php b/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-types.blade.php index 48670b36d..165457e9b 100644 --- a/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-types.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/dashboard/index/revenue-by-types.blade.php @@ -134,10 +134,20 @@ class="dark:mix-blend-exclusion dark:invert" .then(response => { this.report = response.data; + this.extendColors(this.report.statistics.length); + this.isLoading = false; }) .catch(error => {}); - } + }, + + extendColors(length) { + while (this.colors.length < length) { + const hue = Math.floor(Math.random() * 360); + const newColor = `hsl(${hue}, 70%, 60%)`; + this.colors.push(newColor); + } + }, } });