Skip to content

Commit

Permalink
upgraded to php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Jun 16, 2022
1 parent 84ae348 commit e437b8a
Show file tree
Hide file tree
Showing 39 changed files with 889 additions and 4,048 deletions.
19 changes: 0 additions & 19 deletions .scrutinizer.yml

This file was deleted.

46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
![Downloads](https://img.shields.io/packagist/dt/akaunting/laravel-apexcharts)
![Tests](https://img.shields.io/github/workflow/status/akaunting/laravel-apexcharts/Tests?label=tests)
[![StyleCI](https://github.styleci.io/repos/452221855/shield?style=flat&branch=master)](https://styleci.io/repos/452221855)
[![Quality](https://img.shields.io/scrutinizer/quality/g/akaunting/laravel-apexcharts?label=quality)](https://scrutinizer-ci.com/g/akaunting/laravel-apexcharts)
[![License](https://img.shields.io/github/license/akaunting/laravel-apexcharts)](LICENSE.md)

This package allows you to generate modern and interactive charts using the [ApexCharts](https://apexcharts.com) library directly from Laravel without interacting with JavaScript, CSS, etc.
This package allows you to generate modern and interactive charts using the [ApexCharts](https://apexcharts.com) library directly from `Laravel` without interacting with JavaScript, CSS, etc.

It covers all of the chart [types](https://apexcharts.com/docs/chart-types/line-chart) and [options](https://apexcharts.com/docs/options/annotations) available within the `ApexChart` library.

## Getting Started

Expand All @@ -28,14 +29,18 @@ php artisan vendor:publish --tag=apexcharts

### 3. Configure

You can change the column sorting settings of your app from `config/apexcharts.php` file
You can change the chart settings of your app from `config/apexcharts.php` file

## Usage

First of all, create an instance of the `Chart` class and set the data and options according to your needs.

```php
use Akaunting\Apexcharts\Charts;
use Akaunting\Apexcharts\Chart;

$chart = new Charts();
...

$chart = new Chart();

$chart->setType('donut')
->setWidth('100%')
Expand All @@ -45,28 +50,25 @@ $chart->setType('donut')
$chart->setDataset('Name', 'donut', [1907, 1923]);
```

## Blade
Then, include the JavaScript (on every page using charts).

```php
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8; charset=ISO-8859-1"/>
```html
...

<title>Apexcharts Sample Donut Chart</title>
</head>
</head>
<body>
...

<body>
{!! $chart->container() !!}
@apexchartsScripts
</body>
```

Finally, call the `container` and `script` method wherever you want to display the chart.

@apexchartsScripts
```php
{!! $chart->container() !!}

{{ $chart->script() }}
</body>
</html>
{!! $chart->script() !!}
```

## Changelog
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
}
],
"require": {
"php": ">=7.3",
"illuminate/support": ">=8.0",
"php": ">=8.0",
"ext-json": "*",
"balping/json-raw-encoder": "^1.0",
"ext-json": "*"
"illuminate/support": ">=8.0"
},
"require-dev": {
"phpunit/phpunit": ">=9.0",
Expand Down
Loading

0 comments on commit e437b8a

Please sign in to comment.