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

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

Open
tititorn opened this issue Apr 28, 2020 · 0 comments
Open

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

tititorn opened this issue Apr 28, 2020 · 0 comments

Comments

@tititorn
Copy link

tititorn commented Apr 28, 2020

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'),


        ];
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

No branches or pull requests

1 participant