Skip to content

Commit

Permalink
ChartJS as plugin (jeroennoten#141)
Browse files Browse the repository at this point in the history
* Added ChartJS as adminlte plugin

* Added documentation for ChartJS usage
  • Loading branch information
apisznasdin authored and jeroennoten committed Oct 17, 2017
1 parent 7211b89 commit d41e777
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ Also the [Select2](https://select2.github.io/) plugin is supported. If set to `t
]
```

Also the [ChartJS](https://www.chartjs.org/) plugin is supported. If set to `true`, the necessary javascript CDN script tags will automatically be injected into the `adminlte::page.blade` file.

```php
'plugins' => [
'datatables' => true,
'chartjs' => true,
]
```


## 6. Translations

Expand Down
1 change: 1 addition & 0 deletions config/adminlte.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,6 @@
'plugins' => [
'datatables' => true,
'select2' => true,
'chartjs' => true,
],
];
5 changes: 5 additions & 0 deletions resources/views/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<script src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
@endif

@if(config('adminlte.plugins.chartjs'))
<!-- ChartJS -->
<script src="//cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.bundle.min.js"></script>
@endif

@yield('adminlte_js')

</body>
Expand Down

0 comments on commit d41e777

Please sign in to comment.