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

Install instructions? #8

Open
MACscr opened this issue Aug 6, 2020 · 1 comment
Open

Install instructions? #8

MACscr opened this issue Aug 6, 2020 · 1 comment

Comments

@MACscr
Copy link

MACscr commented Aug 6, 2020

The install instructions are a bit vague. Ive installed other cards (like Nova Charts) with no problems, but get the following error:

Error
Class 'App\Providers\TextCard' not found

Trying to add the text card in NoveServiceProvider.php

    /**
     * Get the cards that should be displayed on the default Nova dashboard.
     *
     * @return array
     */
    protected function cards()
    {
        return [
          (new StackedChart())
              ->title('Revenue')
              ->series(array([
                  'barPercentage' => 0.5,
                  'label' => 'Product #1',
                  'backgroundColor' => '#ffcc5c',
                  'data' => [30, 70, 80],
              ],[
                  'barPercentage' => 0.5,
                  'label' => 'Product #2',
                  'backgroundColor' => '#ff6f69',
                  'data' => [40, 62, 79],
              ]))
              ->options([
                  'xaxis' => [
                      'categories' => [ 'Jan', 'Feb', 'Mar' ]
                  ],
              ])
              ->width('1/3'),
              (new StackedChart())
                  ->title('Test')
                  ->series(array([
                      'barPercentage' => 0.5,
                      'label' => 'Product #1',
                      'backgroundColor' => '#ffcc5c',
                      'data' => [30, 70, 80],
                  ],[
                      'barPercentage' => 0.5,
                      'label' => 'Product #2',
                      'backgroundColor' => '#ff6f69',
                      'data' => [40, 62, 79],
                  ]))
                  ->options([
                      'xaxis' => [
                          'categories' => [ 'Jan', 'Feb', 'Mar' ]
                      ],
                  ])
                  ->width('1/3'),
              (new TextCard())
                  ->width('1/3')
                  ->height(100)
                  ->center(false)
                  ->heading('Custom card no centered')
                  ->text('Congue platea augue fames nullam morbi'),

          (new StackedChart())
              ->title('Revenue')
              ->animations([
                  'enabled' => true,
                  'easing' => 'easeinout',
              ])
              ->series(array([
                  'barPercentage' => 0.5,
                  'label' => 'Average Sales',
                  'backgroundColor' => '#999',
                  'data' => [80, 90, 80, 40, 62, 79, 79, 90, 90, 90, 92, 91],
              ],[
                  'barPercentage' => 0.5,
                  'label' => 'Average Sales 2',
                  'backgroundColor' => '#F87900',
                  'data' => [40, 62, 79, 80, 90, 79, 90, 90, 90, 92, 91, 80],
              ]))
              ->options([
                  'xaxis' => [
                      'categories' => [ 'Jan', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct' ]
                  ],
              ]),
        ];
    }
@smartens80
Copy link

@MACscr Include the full namespace like (new \Ericlagarda\NovaTextCard\TextCard())

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

2 participants