File tree Expand file tree Collapse file tree 6 files changed +303
-79
lines changed
storage/framework/defaults/views/dashboard Expand file tree Collapse file tree 6 files changed +303
-79
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,18 @@ const formatDate = (daysAgo: number) => {
116
116
117
117
// Generate date labels for the selected time range
118
118
const generateDateLabels = (days : number ) => {
119
- return Array .from ({ length: days }, (_ , i ) => formatDate (days - 1 - i )).reverse ()
119
+ // Start from oldest date and move towards today
120
+ return Array .from ({ length: days }, (_ , i ) => formatDate (i ))
121
+ }
122
+
123
+ // Generate mock growth data
124
+ const generateGrowthData = (days : number , baseCount : number , dailyGrowth : number ) => {
125
+ // Start from oldest date and move towards today
126
+ return Array .from ({ length: days }, (_ , i ) => {
127
+ const dayVariance = Math .random () * dailyGrowth * 0.5 // 50% variance
128
+ const daysFromStart = i
129
+ return Math .floor (baseCount + (dailyGrowth * daysFromStart ) + dayVariance )
130
+ })
120
131
}
121
132
122
133
interface DownloadStats {
Original file line number Diff line number Diff line change @@ -116,7 +116,18 @@ const formatDate = (daysAgo: number) => {
116
116
117
117
// Generate date labels for the selected time range
118
118
const generateDateLabels = (days : number ) => {
119
- return Array .from ({ length: days }, (_ , i ) => formatDate (days - 1 - i )).reverse ()
119
+ // Start from oldest date and move towards today
120
+ return Array .from ({ length: days }, (_ , i ) => formatDate (i ))
121
+ }
122
+
123
+ // Generate mock growth data
124
+ const generateGrowthData = (days : number , baseCount : number , dailyGrowth : number ) => {
125
+ // Start from oldest date and move towards today
126
+ return Array .from ({ length: days }, (_ , i ) => {
127
+ const dayVariance = Math .random () * dailyGrowth * 0.5 // 50% variance
128
+ const daysFromStart = i
129
+ return Math .floor (baseCount + (dailyGrowth * daysFromStart ) + dayVariance )
130
+ })
120
131
}
121
132
122
133
interface FunctionStats {
Original file line number Diff line number Diff line change @@ -285,8 +285,9 @@ const generateDateLabels = (days: number) => {
285
285
const generateGrowthData = (days : number , baseCount : number , dailyGrowth : number ) => {
286
286
return Array .from ({ length: days }, (_ , i ) => {
287
287
const dayVariance = Math .random () * dailyGrowth * 0.5 // 50% variance
288
- return Math .floor (baseCount + (dailyGrowth * i ) + dayVariance )
289
- })
288
+ const daysFromStart = days - 1 - i
289
+ return Math .floor (baseCount + (dailyGrowth * daysFromStart ) + dayVariance )
290
+ }).reverse ()
290
291
}
291
292
292
293
// Chart options
Original file line number Diff line number Diff line change @@ -276,8 +276,9 @@ const generateDateLabels = (days: number) => {
276
276
const generateGrowthData = (days : number , baseCount : number , dailyGrowth : number ) => {
277
277
return Array .from ({ length: days }, (_ , i ) => {
278
278
const dayVariance = Math .random () * dailyGrowth * 0.5 // 50% variance
279
- return Math .floor (baseCount + (dailyGrowth * i ) + dayVariance )
280
- })
279
+ const daysFromStart = days - 1 - i
280
+ return Math .floor (baseCount + (dailyGrowth * daysFromStart ) + dayVariance )
281
+ }).reverse ()
281
282
}
282
283
283
284
// Chart options
Original file line number Diff line number Diff line change @@ -241,8 +241,9 @@ const generateDateLabels = (days: number) => {
241
241
const generateGrowthData = (days : number , baseCount : number , dailyGrowth : number ) => {
242
242
return Array .from ({ length: days }, (_ , i ) => {
243
243
const dayVariance = Math .random () * dailyGrowth * 0.5 // 50% variance
244
- return Math .floor (baseCount + (dailyGrowth * i ) + dayVariance )
245
- })
244
+ const daysFromStart = days - 1 - i
245
+ return Math .floor (baseCount + (dailyGrowth * daysFromStart ) + dayVariance )
246
+ }).reverse ()
246
247
}
247
248
248
249
// Chart options
You can’t perform that action at this time.
0 commit comments