项目作者: dcasia

项目描述 :
A Laravel Nova ApexCharts Component
高级语言: PHP
项目地址: git://github.com/dcasia/nova-apex-chart.git
创建时间: 2019-12-09T07:58:25Z
项目社区:https://github.com/dcasia/nova-apex-chart

开源协议:MIT License

下载


Nova Apex Chart

Latest Version on Packagist
Total Downloads
License

A Laravel Nova ApexCharts Component

ApexCharts Documentation

SliderFilter in Action

Installation

You can install the package via composer:

  1. composer require digital-creative/nova-apex-chart

Basic Usage

  1. use DigitalCreative\NovaApexChart\NovaApexChart;
  2. use DigitalCreative\NovaApexChart\Formatter\BasicFormatter;
  3. use DigitalCreative\NovaApexChart\Series\DataOnlySeries;
  4. class ExampleNovaResource extends Resource
  5. {
  6. public function cards(Request $request)
  7. {
  8. return [
  9. (new NovaApexChart())
  10. ->type('bar')
  11. ->series(
  12. [
  13. new DataOnlySeries([ 400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380 ])
  14. ])
  15. ->options([
  16. 'xaxis' => [
  17. 'categories' => [ 'Jan', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct' ]
  18. ],
  19. 'tooltip' => [
  20. 'y' => [
  21. 'formatter' => new BasicFormatter('$', 'USD')
  22. ]
  23. ]
  24. ])
  25. ];
  26. }
  27. }

Create basic series by calling

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

Create data only series by calling

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

Create custom formatter

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

Show comma separated numbers

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

License

The MIT License (MIT). Please see License File for more information.