Level 75
I really am not familiar with that chart program, but just wondering is that width correct.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I got an error of "Undefined variable: chart" when i want to render my charts. I dont know how this error occured but when i dd the data it shows me but when i render it in table it gets me an error. I already imported and installed consoleTV's chart package and still it gets me an error.
graph.blade.php
@extends('coin.app')
@section('graph')
{!! $chart->render() !!}
@endsection
GraphController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use Illuminate\Support\Facades\DB;
use Charts;
use App\Graph;
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$chart = Charts::database(Graph::get()->find(1),'line','highcharts')
->title('Coins')
->Width(0)
->Responsive(true);
// dd($chart);
return view('coin.app', ['chart' => $chart]);
}
}
web.php
//home
Route::get('/coindeoro', function()
{
// return view('coin.app');
return View::make('coin.news');
});
app.blade.php
stylesheets....
{!! Charts::assets() !!}
content....
@yield('graph')
scripts....
Please or to participate in this conversation.