Remove package fx3costa/laravelchartjs
This commit is contained in:
parent
da48fd84dc
commit
4c54a391be
@ -31,43 +31,39 @@ class AdminController extends Controller
|
||||
$data['texture_uploads'][] = Texture::like('upload_at', $time->toDateString())->count();
|
||||
}
|
||||
|
||||
$chart = app()->chartjs
|
||||
->name('overview_chart')
|
||||
->type('line')
|
||||
->size(['width' => 400, 'height' => 200])
|
||||
->labels($labels)
|
||||
->datasets([
|
||||
[
|
||||
'label' => trans('admin.index.user-registration'),
|
||||
'backgroundColor' => 'rgba(60, 141, 188, 0.6)',
|
||||
'borderColor' => '#3c8dbc',
|
||||
'pointRadius' => 0,
|
||||
'pointBorderColor' => '#3c8dbc',
|
||||
'pointBackgroundColor' => '#3c8dbc',
|
||||
'pointHoverBackgroundColor' => '#3c8dbc',
|
||||
'pointHoverBorderColor' => '#3c8dbc',
|
||||
'data' => $data['user_registration'],
|
||||
],
|
||||
[
|
||||
'label' => trans('admin.index.texture-uploads'),
|
||||
'backgroundColor' => 'rgba(210, 214, 222, 0.6)',
|
||||
'borderColor' => '#d2d6de',
|
||||
'pointRadius' => 0,
|
||||
'pointBorderColor' => '#c1c7d1',
|
||||
'pointBackgroundColor' => '#c1c7d1',
|
||||
'pointHoverBackgroundColor' => '#c1c7d1',
|
||||
'pointHoverBorderColor' => '#c1c7d1',
|
||||
'data' => $data['texture_uploads'],
|
||||
]
|
||||
])
|
||||
->options([
|
||||
'tooltips' => [
|
||||
'intersect' => false,
|
||||
'mode' => 'index'
|
||||
]
|
||||
]);
|
||||
$datasets = [
|
||||
[
|
||||
'label' => trans('admin.index.user-registration'),
|
||||
'backgroundColor' => 'rgba(60, 141, 188, 0.6)',
|
||||
'borderColor' => '#3c8dbc',
|
||||
'pointRadius' => 0,
|
||||
'pointBorderColor' => '#3c8dbc',
|
||||
'pointBackgroundColor' => '#3c8dbc',
|
||||
'pointHoverBackgroundColor' => '#3c8dbc',
|
||||
'pointHoverBorderColor' => '#3c8dbc',
|
||||
'data' => $data['user_registration'],
|
||||
],
|
||||
[
|
||||
'label' => trans('admin.index.texture-uploads'),
|
||||
'backgroundColor' => 'rgba(210, 214, 222, 0.6)',
|
||||
'borderColor' => '#d2d6de',
|
||||
'pointRadius' => 0,
|
||||
'pointBorderColor' => '#c1c7d1',
|
||||
'pointBackgroundColor' => '#c1c7d1',
|
||||
'pointHoverBackgroundColor' => '#c1c7d1',
|
||||
'pointHoverBorderColor' => '#c1c7d1',
|
||||
'data' => $data['texture_uploads'],
|
||||
]
|
||||
];
|
||||
|
||||
return view('admin.index', compact('chart'));
|
||||
$options = [
|
||||
'tooltips' => [
|
||||
'intersect' => false,
|
||||
'mode' => 'index'
|
||||
]
|
||||
];
|
||||
|
||||
return view('admin.index', ['chartOptions' => compact('labels', 'datasets', 'options')]);
|
||||
}
|
||||
|
||||
public function customize(Request $request)
|
||||
|
@ -12,8 +12,7 @@
|
||||
"doctrine/inflector": "1.1.0",
|
||||
"laravel/framework": "5.2.*",
|
||||
"devitek/yaml-translation": "^2.0",
|
||||
"printempw/laravel-datatables-lite": "^1.0",
|
||||
"fx3costa/laravelchartjs": "^2.5"
|
||||
"printempw/laravel-datatables-lite": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"fzaninotto/faker": "~1.4",
|
||||
|
54
composer.lock
generated
54
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "93065cb8a9e776fe417866c9741f35e5",
|
||||
"content-hash": "7cc7aede94ac363755668bb4198c9ca4",
|
||||
"packages": [
|
||||
{
|
||||
"name": "classpreloader/classpreloader",
|
||||
@ -301,58 +301,6 @@
|
||||
],
|
||||
"time": "2017-10-15T13:05:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fx3costa/laravelchartjs",
|
||||
"version": "2.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fxcosta/laravel-chartjs.git",
|
||||
"reference": "21eaf327118ca512b6503979d4ae75ad3a463e68"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://files.phpcomposer.com/files/fxcosta/laravel-chartjs/21eaf327118ca512b6503979d4ae75ad3a463e68.zip",
|
||||
"reference": "21eaf327118ca512b6503979d4ae75ad3a463e68",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.* || 5.6.*",
|
||||
"php": ">=5.6.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Fx3costa\\LaravelChartJs\\Providers\\ChartjsServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Fx3costa\\LaravelChartJs\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Felix",
|
||||
"email": "fx3costa@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library",
|
||||
"keywords": [
|
||||
"chart",
|
||||
"chartjs",
|
||||
"fx3costa",
|
||||
"graphics",
|
||||
"laravel5",
|
||||
"reports"
|
||||
],
|
||||
"time": "2018-02-20T17:00:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "gregwar/captcha",
|
||||
"version": "v1.1.5",
|
||||
|
@ -162,7 +162,6 @@ return [
|
||||
Devitek\Core\Translation\TranslationServiceProvider::class,
|
||||
Swiggles\Memcache\MemcacheServiceProvider::class,
|
||||
Yajra\Datatables\DatatablesServiceProvider::class,
|
||||
Fx3costa\LaravelChartJs\Providers\ChartjsServiceProvider::class,
|
||||
|
||||
/**
|
||||
* Application Service Providers...
|
||||
|
@ -71,9 +71,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="chart">
|
||||
{!! $chart->render() !!}
|
||||
</div>
|
||||
<canvas id="overview" width="400" height="200"></canvas>
|
||||
<div class="chart"></div>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
@ -83,4 +82,16 @@
|
||||
</div><!-- /.content-wrapper -->
|
||||
|
||||
<script type="text/javascript" src="{{ assets('js/chart.js') }}"></script>
|
||||
<script>
|
||||
var chartOptions = {!! json_encode($chartOptions) !!};
|
||||
|
||||
var chart = new Chart(document.getElementById('overview').getContext('2d'), {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: chartOptions.labels,
|
||||
datasets: chartOptions.datasets
|
||||
},
|
||||
options: chartOptions.options
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
Loading…
Reference in New Issue
Block a user