Welcome Guest, Not a member yet? Register   Sign In
Quickchart package not found
#1

Hi,

I use CI4 on WAMP and PHP 7.3.5.
I've installed ianw/quickchart package to create PNG chart and put it in a html page. Next I convert it in PDF with dompdf.
In a model I wrote

PHP Code:
use Ianw/Quickchart

When I use :

PHP Code:
$qc = new QuickChart(array(
          'width'=> 600,
          'height'=> 300,
        )); 
An error appear : Class 'Ianw/Quickchart' not found
I don't know why.
Can you help me ?
Reply
#2

The problem might be from the namespace. You need to answer some questions:

- How did you install the package? Composer or manually?
- Where exactly is the package located?

Check the file for the correct namespace to use.
Reply
#3

Must be a name space issue, where did you install the package at (directory structure)?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

PHP Code:
use Ianw\Quickchart
Reply
#5

I've installed it with composer.
It's located in \vendor\ianw\quickchart
Reply
#6

Code below works. You do not add row "use Ianw/Quickchart;"
PHP Code:
$qc = new \QuickChart([
 
  'width'=> 500,
 
  'height'=> 300,
 ]); 
Reply
#7

See https://packagist.org/packages/ianw/quickchart
https://github.com/typpo/quickchart-php/...kChart.php

It is not namespaced. \QuickChart is correct.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB