chart test

This commit is contained in:
2019-07-08 22:22:12 -05:00
parent 77d490c9c3
commit 5521abbf95
2 changed files with 36 additions and 2 deletions

View File

@@ -58,6 +58,8 @@ class FuelController extends Controller
public function displayStructureFuel($id) {
//Declare class variables
$lava = new Lavacharts;
$charts = array();
$chartsDiv = array();
$aHelper = new AssetHelper(null, null, null);
$structure = Structure::where(['structure_id' => $id])->first();
@@ -89,12 +91,40 @@ class FuelController extends Controller
'redColor' => '#109618',
'majorTicks' => [
'Empty',
'Ok',
'Full',
],
]);
for($i = 0; $i <= 5; $i++) {
$charts[$i] = new Lavacharts;
$chartsDiv[$i] = 'chart-div' . $i;
$stuff->addStringColumn('Fuel')
->addNumberColumn('Units')
->addRow(['Liquid Ozone', 500000]);
$charts[$i]->GaugeChart('Liquid Ozone', $stuff, [
'min' => 0,
'max' => 1000000,
'width' => 400,
'greenFrom' => 0,
'greenTo' => 150000,
'greenColor' => '#DC3912',
'yellowFrom' => 150000,
'yellowTo' => 300000,
'yellowColor' => '#FF9900',
'redFrom' => 300000,
'redTo' => 1000000,
'redColor' => '#109618',
'majorTicks' => [
'Empty',
'Full',
],
]);
}
//Return the view
return view('logistics.display.fuelgauge')->with('lava', $lava)
->with('name', $name);
->with('name', $name)
->with('charts', $charts)
->with('chartsDiv', $chartsDiv);
}
}

View File

@@ -13,4 +13,8 @@
</div>
</div>
<br>
@for($i = 0; $i <= 5; $i++)
<div id="{{ $chartsDiv[$i] }}"></div>
{!! $charts[$i]->render('GaugeChart', 'Liquid Ozone', $chartsDiv[$i]) !!}
@endfor
@endsection