Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions demo/app/Sharp/Dashboard/DemoDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function buildWidgets(WidgetsContainer $widgetsContainer): void
SharpBarGraphWidget::make('authors_bar')
->setTitle('Posts by author')
->setShowLegend(false)
->setHorizontal(),
// ->setHorizontal(),
)
->addWidget(
SharpPieGraphWidget::make('categories_pie')
Expand All @@ -63,7 +63,8 @@ protected function buildWidgets(WidgetsContainer $widgetsContainer): void
->setTitle('Visits')
->setHeight(200)
->setShowLegend()
->setMinimal()
->setDisplayHorizontalAxisAsTimeline()
// ->setMinimal()
->setCurvedLines(),
)
->addWidget(
Expand Down Expand Up @@ -176,7 +177,8 @@ protected function setLineGraphDataSet(): void
{
$visits = collect(CarbonPeriod::create($this->getStartDate(), $this->getEndDate()))
->mapWithKeys(function (Carbon $day, $k) {
return [$day->isoFormat('L') => (int) (rand(10000, 20000) * 1.02)];
// return [$day->isoFormat('L') => (int) (rand(10000, 20000) * 1.02)];
return [$day->format('Y-m-d') => (int) (rand(10000, 20000) * 1.02)];
});

$this
Expand Down Expand Up @@ -205,7 +207,7 @@ protected function setBarsGraphDataSet(): void
)]
)
->orderBy('posts_count', 'desc')
->limit(8)
->limit(10)
->get()
->pluck('posts_count', 'name');

Expand Down
2 changes: 2 additions & 0 deletions demo/database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function run()
$editor2 = User::factory(['email' => '[email protected]'])
->create();

User::factory(50)->create();

collect([$admin, $editor1, $editor2])
->shuffle()
->each(function (User $user, int $k) {
Expand Down
Loading
Loading