Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added chart type option #5

Merged
merged 4 commits into from
Jan 25, 2025
Merged

Added chart type option #5

merged 4 commits into from
Jan 25, 2025

Conversation

DissNik
Copy link
Member

@DissNik DissNik commented Jan 9, 2025

The size of the array of types may not match the strings.

For testing:

Grid::make([
    Column::make([
        LineChartMetric::make('Заказы')
            ->line([
                'Выручка 1' => [
                    now()->format('Y-m-d') => 100,
                    now()->addDay()->format('Y-m-d') => 200
                ]
            ], type: fn() => ['line', 'line'])
            ->line([
                'Выручка 2' => [
                    now()->format('Y-m-d') => 300,
                    now()->addDay()->format('Y-m-d') => 400
                ]
            ], '#EC4176',  type: fn() => 'area'),
    ])->columnSpan(6),

    Column::make([
        LineChartMetric::make('Заказы')
            ->line(
                [
                    'Выручка 1' => [
                        now()->format('Y-m-d') => 100,
                        now()->addDay()->format('Y-m-d') => 200
                    ],
                    'Выручка 2' => [
                        now()->format('Y-m-d') => 200,
                        now()->addDay()->format('Y-m-d') => 300
                    ],
                    'Выручка 3' => [
                        now()->format('Y-m-d') => 300,
                        now()->addDay()->format('Y-m-d') => 400
                    ],
                ],
                color: ['#EC4176' , '#7843E9'],
                type: ['area', 'line', 'line']
            ),
    ])->columnSpan(6),
]),

@DissNik DissNik merged commit 136a5fb into master Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants