test chart
This commit is contained in:
20
app/Charts/ADChart.php
Normal file
20
app/Charts/ADChart.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Charts;
|
||||||
|
|
||||||
|
use ConsoleTVs\Charts\Classes\ChartJs\Chart;
|
||||||
|
|
||||||
|
class ADChart extends Chart
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Initializes the chart.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
|
|||||||
use DB;
|
use DB;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Khill\Lavacharts\Lavacharts;
|
use Khill\Lavacharts\Lavacharts;
|
||||||
|
use App\Charts\AD;
|
||||||
|
|
||||||
//User Libraries
|
//User Libraries
|
||||||
use App\Library\SRP\SRPHelper;
|
use App\Library\SRP\SRPHelper;
|
||||||
@@ -115,6 +116,30 @@ class SRPAdminController extends Controller
|
|||||||
//We need a function from this library rather than recreating a new library
|
//We need a function from this library rather than recreating a new library
|
||||||
$srpHelper = new SRPHelper();
|
$srpHelper = new SRPHelper();
|
||||||
|
|
||||||
return view('srp.admin.statistics');
|
|
||||||
|
$lava = new Lavacharts; // See note below for Laravel
|
||||||
|
|
||||||
|
$reasons = $lava->DataTable();
|
||||||
|
|
||||||
|
$reasons->addStringColumn('Reasons')
|
||||||
|
->addNumberColumn('Percent')
|
||||||
|
->addRow(['Check Reviews', 5])
|
||||||
|
->addRow(['Watch Trailers', 2])
|
||||||
|
->addRow(['See Actors Other Work', 4])
|
||||||
|
->addRow(['Settle Argument', 89]);
|
||||||
|
|
||||||
|
$lava->PieChart('IMDB', $reasons, [
|
||||||
|
'title' => 'Reasons I visit IMDB',
|
||||||
|
'is3D' => true,
|
||||||
|
'slices' => [
|
||||||
|
['offset' => 0.2],
|
||||||
|
['offset' => 0.25],
|
||||||
|
['offset' => 0.3]
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
return view('srp.admin.statistics')->with('reasons', $reasons)
|
||||||
|
->with('lava', $lava);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
@extends('layouts.b4')
|
@extends('srp.layouts.b4')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
|
<div id="chart-div"></div>
|
||||||
|
{!! Lava::render('PieChart', 'IMDB', 'chart-div') !!}
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
41
resources/views/srp/layouts/b4.blade.php
Normal file
41
resources/views/srp/layouts/b4.blade.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-140677389-1"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', 'UA-140677389-1');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<title>{{ config('app.name', 'W4RP Services') }}</title>
|
||||||
|
<!-- Required meta tags -->
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
|
||||||
|
<!-- CSRF Token -->
|
||||||
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
||||||
|
<!-- Bootstrap CSS
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
|
||||||
|
-->
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
@include('layouts.navbar')
|
||||||
|
<div class="container">
|
||||||
|
@include('inc.messages')
|
||||||
|
</div>
|
||||||
|
@yield('content')
|
||||||
|
<!-- Optional JavaScript -->
|
||||||
|
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js" charset="utf-8"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user