sample chart

This commit is contained in:
2019-07-01 22:55:44 -05:00
parent d31e1e4bfd
commit a9d4c6399f
2 changed files with 30 additions and 3 deletions

View File

@@ -8,7 +8,6 @@ use App\Http\Controllers\Controller;
use DB;
use Auth;
use Khill\Lavacharts\Lavacharts;
use App\Charts\AD;
//User Libraries
use App\Library\SRP\SRPHelper;
@@ -116,7 +115,7 @@ class SRPAdminController extends Controller
//We need a function from this library rather than recreating a new library
$srpHelper = new SRPHelper();
//Pie Chart for approval, denied, and under review
$lava = new Lavacharts; // See note below for Laravel
$reasons = $lava->DataTable();
@@ -132,7 +131,30 @@ class SRPAdminController extends Controller
'is3D' => true,
]);
$guage = new Lavacharts; // See note below for Laravel
return view('srp.admin.statistics')->with('lava', $lava);
$adur = $lava->DataTable();
$adur->addStringColumn('Type')
->addNumberColumn('Value')
->addRow(['Under Review', rand(0,100)]);
$guage->GaugeChart('SRP', $adur, [
'width' => 400,
'greenFrom' => 0,
'greenTo' => 69,
'yellowFrom' => 70,
'yellowTo' => 89,
'redFrom' => 90,
'redTo' => 100,
'majorTicks' => [
'Safe',
'Critical'
]
]);
return view('srp.admin.statistics')->with('lava', $lava)
->with('guage', $guage);
}
}

View File

@@ -5,4 +5,9 @@
<div id="chart-div"></div>
{!! $lava->render('PieChart', 'SRP Stats', 'chart-div') !!}
</div>
<div class="container">
<div id="under-review-div"></div>
{!! $guage->render('GaugeChart', 'Under Review', 'under-review-div') !!}
</div>
@endsection