Skip to content

The chart do not fit the 1/2 or 1/3 width of the cards #3

@tititorn

Description

@tititorn

I tried to put the chart on the lens with width('1/2') or width('1/3'). The chart seem to be too large than the card itself as shown in the picture.

image

image

here is my code that I put in the cards

public function cards(Request $request)
    {   
        $PostCountByType = Post::selectRaw('type, count(*) as no_post')->groupBy('type')->orderBy('no_post')->get();
        $y = $PostCountByType->pluck('type')->toArray(); 
        $x = $PostCountByType->pluck('no_post')->toArray(); 
        return [
            (new NovaApexChart())
                    ->type('donut')
                    ->series($x)
                    ->options([
                        'labels' => $y,
                    ])->width('1/3'),
            (new NovaApexChart())
                    ->type('pie')
                    ->series($x)
                    ->options([
                        'labels' => $y,
                    ])->width('1/3'),
            (new NovaApexChart())
                    ->type('bar')
                    ->series([
                        new BasicSeries('No of Post',$x), 
                    ])
                    ->options([
                        'labels' => $y, 
                        'title' => ['text' => 'Post Count by Type'],
                    ])->width('1/3'),


        ];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions