0

I have added the extension (a wraper for google chart) "scotthuangzl/yii2-google-chart": "dev-master" to the require section of my composer.json file. However when I call that extension on views\site\myPage.php I have this error: Class 'scotthuangzl\googlechart\GoogleChart' not found. What I am doing wrong? Thanks.

This is the code where I call the google chart:

<?php
  use scotthuangzl\googlechart\GoogleChart;

  echo GoogleChart::widget(array('visualization' => 'BarChart',
  'data' => array(
  array('Type', 'Value'),
  array('Var1', $model->avg1),
  .............
  ),
 'options' => array('title' => 'Variable - avg1')));
?>
2
  • You Need to update composer after updating adding require section in composer.json Commented Nov 2, 2015 at 18:11
  • Thank you for you answer, I have this issue when updating the composer: Problem 1 - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl e -> no matching package found. - yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl e -> no matching package found. - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl e -> no matching package found. - Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yi i2[2.0.5, 2.0.6]. Commented Nov 2, 2015 at 19:46

1 Answer 1

0

I have solved the issue by using another wraper (https://github.com/miloschuman/yii2-highcharts). (1) I put the following lines in the require section of the composer.json file: "yiisoft/yii2-jui": "*", "miloschuman/yii2-highcharts-widget": "dev-master" (2) And then run in the console the command: composer update

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.