fxcosta / laravel-chartjs

Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library
486 stars 112 forks source link

Method Illuminate\View\View::__toString() must not throw an exception #11

Closed starkbaum closed 7 years ago

starkbaum commented 8 years ago

Hi, when i'm trying out the following Code i get that error

    <div class="container-fluid">
        <canvas id="BarChart" style="width:50%;"></canvas>
    </div>

    <?php
    $data = array(
            'Jan' => array(33),
            'Feb' => array(32),
            'Mar' => array(12)
    );
    ?>

    {!! app()->chartbar->render("BarChart", $data) !!}

Error

FatalErrorException in 8be385e208e531fc8df24170541811c5 line 0: Method Illuminate\View\View::__toString() must not throw an exception

The strange thing is that a few days ago everything worked

What could cause this error?

edit: I downgraded to version 1.3.2 and everything worked fine

fxcosta commented 8 years ago

Thanks for feedback!

I'm already organizing an upgrade in the package to support new versions of chartjs because there were changes in APIs. I'll have to explain the version to use for now, sorry.

AEK-BKF commented 8 years ago

Same error with me ! any update please ?

fxcosta commented 8 years ago

Fixed in 832d69a65c61c4f1d56f5a94f7ac356476fd8043. Thanks for support!

AEK-BKF commented 8 years ago

Thank you so much for reply It works fine :)))

AEK-BKF commented 8 years ago

But there's still a mistake ^^ I tried Bar Chart, it shows me bars but an error in console says : document.getElementById('js-legend-bar').innerHTML = myBar.generateLegend(); TypeError: document.getElementById(...) is null TypeError: labels is undefined