PHP code example of lonnyx / nova-apex-chart

1. Go to this page and download the library: Download lonnyx/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/ */

    

lonnyx / nova-apex-chart example snippets


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 LonnyX\NovaApexChart\BasicSeries;
new BasicSeries('title', [ 400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380 ]);

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

use LonnyX\NovaApexChart\formatter\BasicFormatter;
new BasicFormatter('$', 'USD');

use LonnyX\NovaApexChart\formatter\BasicFormatter;
new BasicFormatter('', '', true);