Yii Framework Forum: Class 'scotthuangzl\googlechart\GoogleChart' not found - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Class 'scotthuangzl\googlechart\GoogleChart' not found

#1 User is offline   noobkoder 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 02-November 17

Posted 02 November 2017 - 09:37 AM

Hello I'm trying to make use of the Google Chart in Yii2, I've use a widget that I found on the Yii wiki.

I've followed all the instruction and it seems like I didn't do anything wrong and I'm getting an error.

<?php

use yii\helpers\Html;
use scotthuangzl\googlechart\GoogleChart;



/* @var $this yii\web\View */


echo GoogleChart::widget(array('visualization' => 'PieChart',
	'data' => array(
		array('Task', 'Hours per Day'),
		array('Work', '11'),
		array('Sleep', '24'),
		array('Commute', '1.5')
		),
	)
)



?>
<h1>Reporting Charts</h1>

<p>
   Currently On Maintenance
</p>


Am I missing something? Pardon my ignorance.

Edit:

By the way, I've already done the composer update and stuff.
0

#2 User is offline   jkofsky 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 683
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 02 November 2017 - 02:28 PM

View Postnoobkoder, on 02 November 2017 - 09:37 AM, said:

Hello I'm trying to make use of the Google Chart in Yii2, I've use a widget that I found on the Yii wiki.

I've followed all the instruction and it seems like I didn't do anything wrong and I'm getting an error.

<?php

use yii\helpers\Html;
use scotthuangzl\googlechart\GoogleChart;



/* @var $this yii\web\View */


echo GoogleChart::widget(array('visualization' => 'PieChart',
	'data' => array(
		array('Task', 'Hours per Day'),
		array('Work', '11'),
		array('Sleep', '24'),
		array('Commute', '1.5')
		),
	)
)



?>
<h1>Reporting Charts</h1>

<p>
   Currently On Maintenance
</p>


Am I missing something? Pardon my ignorance.

Edit:

By the way, I've already done the composer update and stuff.

Do you actually have scotthuangzl\googlechart\GoogleChart in the vendor directory?
Do, or do not. There is no 'try.' Jedi Master Yoda
0

#3 User is offline   noobkoder 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 02-November 17

Posted 04 November 2017 - 05:31 AM

View Postjkofsky, on 02 November 2017 - 02:28 PM, said:

Do you actually have scotthuangzl\googlechart\GoogleChart in the vendor directory?


Of course.

That's why I've already done the composer update.

EDIT:

I have fixed it, what I've done was I deleted the folder of the widget and did a composer update then I installed it again.
1

#4 User is offline   jkofsky 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 683
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 08 November 2017 - 01:29 PM

I wasn't being flippant. Just asking in case composer didn't work. Which it looks like it didn't :)
Do, or do not. There is no 'try.' Jedi Master Yoda
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users