PHP code example of digital-creative / nova-apex-chart

1. Go to this page and download the library: Download digital-creative/nova-apex-chart library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

digital-creative / nova-apex-chart example snippets


use DigitalCreative\NovaApexChart\NovaApexChart;
use DigitalCreative\NovaApexChart\Formatter\BasicFormatter;
use DigitalCreative\NovaApexChart\Series\DataOnlySeries;

class ExampleNovaResource extends Resource
{

    public function cards(Request $request)
        {
    
            return [
                (new NovaApexChart())
                    ->type('bar')
                    ->series(
                        [
                            new DataOnlySeries([ 400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380 ])
                        ])
                    ->options([
                        'xaxis' => [
                            'categories' => [ 'Jan', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct' ]
                        ],
                        'tooltip' => [
                            'y' => [
                                'formatter' => new BasicFormatter('$', 'USD')
                            ]
                        ]
                    ])
            ];
        }

}

use DigitalCreative\NovaApexChart\Series\BasicSeries;
new BasicSeries('title', [ 400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380 ]);

use DigitalCreative\NovaApexChart\Series\DataOnlySeries;
new DataOnlySeries([ 400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380 ]);

use DigitalCreative\NovaApexChart\Formatter\BasicFormatter;
new BasicFormatter('$', 'USD');

use DigitalCreative\NovaApexChart\Formatter\BasicFormatter;
new BasicFormatter('', '', true);