Skip to content

Commit

Permalink
Paquete estable commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gebrail committed Dec 12, 2022
0 parents commit 1b8853f
Show file tree
Hide file tree
Showing 27 changed files with 3,070 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.phpunit.result.cache
vendor/
composer.lock
.idea
coverage/
coverage.txt
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Wilson Barrera

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Charts Reports
Paquete para generar gráficos con Amcharts directamente desde laravel, sin interactuar con JavaScript.

### Guia de inicio rapido

#### Pre-requisitos

No hay configuración adicional u otros parámetros todavía.
> 🔰 Este paquete se puede usar en **Laravel 7 o superior.**
### Instalación
Puedes instalar el paquete a través de composer

```bash
composer require gebrail/charts-reports
```

> 🔰 Este paquete tambien ofrece la opción de generar graficas con artisan, mediante la interfaz de línea de comandos que viene junto a Laravel.

## Guia rapida de como usar

### Ejemplo

Para crear su primer gráfico, diríjase a su controlador.
#### En su controlador agregue las siguientes lineas

```PHP

$data = User::select(array('name', 'sales'))->take(3)->get();

$options = [
'chart_name' => 'Donut Chart',
'chart_type' => 'Pie & Donut',
'chart_subtype' => 'Donut',
'field_category' => 'name',
'field_value' => 'sales',
'chart_data'=> $data,
];
$chart = new ChartReport($options);

return view('graph', compact('chart'));

```

#### Agregue las siguientes lineas a su vista

```HTML
<!doctype html>
<html lang="en">
<head>
{!! $chart->renderChartLibrary() !!}
{!! $chart->renderJs() !!}
</head>
<body>
{!! $chart->renderHtml() !!}
</body>
</html>
```

Para generar la gráfica debemos hacer el llamado de la función renderHtml(), podemos usarla en cualquier parte siempre que este dentro de la etiqueta body.

###Resultado

![](https://3156765290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvWJzDEJMsRQQEBckKtD8%2Fuploads%2FUtHsNMsshE4puV9J68CD%2FScreenshot%202022-06-06%20at%2022-47-21%20Donut%20chart%20.png?alt=media&token=0fe9ab4b-af13-4cac-9912-b3af125ec5b3)

###Graficas disponibles del paquete

- Simple Pie Chart.
- Donut Chart.
- Dragging Pie Slices
- Simple Column
- Column with Rotated Labels.
- Clustered Column Chart.
- Line & Area

##📘[Ir a la Documentación](https://gebrail.gitbook.io/charts-reports/)

## License
[MIT](./LICENSE.md)
31 changes: 31 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "gebrail/charts-reports",
"description": "Package to generate charts with Amcharts directly from laravel , without interacting with JavaScript.",
"license": "MIT",
"authors": [
{
"name": "Wilson Gebrail Barrera",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Gebrail\\ChartsReports\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Gebrail\\ChartsReports\\Tests\\":"tests/"
}
},
"require-dev": {
"orchestra/testbench": "^6.0"
},
"extra": {
"laravel": {
"providers": [
"Gebrail\\ChartsReports\\ChartsReportsServiceProvider"
]
}
}
}
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</phpunit>
Loading

0 comments on commit 1b8853f

Please sign in to comment.