Q:

Unable to render LineChart in Laravel 5.1 created using Lavacharts

I have followed the tutorial https://github.com/kevinkhill/lavacharts to render the chart in my application based on Laravel 5.1. But Unable to render it. It gives me error LineChart('Stocks') was not found in View. Below is my controller code & view code. What changes are required to fix this issue?
ChartController.php
public function generatecharts()
{

$lava = new Lavacharts;
$stocksTable = $lava->DataTable();

 $stocksTable->addDateColumn('Day of Month')
            ->addNumberColumn('Projected')
            ->addNumberColumn('Official');

// Random Data For Example
for ($a = 1; $a < 30; $a++)
{
    $rowData = array(
      "2014-8-$a", rand(800,1000), rand(800,1000)
    );

    $stocksTable->addRow($rowData);
}

  $Chart = $lava->LineChart('Stocks')
                ->setOptions(array(
                    'datatable' => $stocksTable,
                    'title' => 'Stock Market Trends'
                  ));

return view('pages.analytics');

}

analytics.blade.php
@extends('layouts.app')
@section('title') analytics:: @parent @stop
@section('content')

<div class="row">
    <div class="page-header">
        <h2>Welcome to analytics</h2>
    </div>

</div>
<div id="stock-div"></div>
echo $lava->render('LineChart', 'Stocks', 'stock-div');
@linechart('Stocks', 'stocks-div');

@endsection

A:

1) It stated in the documentation that if you are using Laravel, you need to change         
$lava-> to \Lava:: (the slash is important)

2) Actually this line of code:
 echo $lava->render('LineChart', 'Stocks', 'stock-div');

is equivalent to this line:
 @linechart('Stocks', 'stocks-div');

So you have a repeating code here (just delete one line). 
You have 3 options to put in your view: 
You can use PHP tag:
<?php echo \Lava::render('LineChart', 'Stocks', 'stock-div'); ?>

or you can use this:
{!! \Lava::render('LineChart', 'Stocks', 'stock-div') !!}

or this simplified version
@linechart('Stocks', 'stocks-div');

Solution:
ChartController.php
public function generatecharts()
{

$stocksTable = \Lava::DataTable();

 $stocksTable->addDateColumn('Day of Month')
            ->addNumberColumn('Projected')
            ->addNumberColumn('Official');

// Random Data For Example

for ($a = 1; $a < 30; $a++)
{
    $rowData = array(
      "2014-8-$a", rand(800,1000), rand(800,1000)
    );

    $stocksTable->addRow($rowData);
}

  $Chart = \Lava::LineChart('Stocks')
                ->setOptions(array(
                    'datatable' => $stocksTable,
                    'title' => 'Stock Market Trends'
                  ));

return view('pages.analytics');

}

analytics.blade.php
@extends('layouts.app')
@section('title') analytics:: @parent @stop
@section('content')

<div class="row">
    <div class="page-header">
        <h2>Welcome to analytics</h2>
    </div>

</div>
<div id="stock-div"></div>

{!! \Lava::render('LineChart', 'Stocks', 'stock-div') !!}

@endsection

