Download the PHP package sjaakp/yii2-gcharts without Composer

On this page you can find all versions of the php package sjaakp/yii2-gcharts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-gcharts

yii2-gcharts

Google Charts the Yii 2.0 way

Latest Stable Version Total Downloads License

yii2-gcharts is a collection of widgets to render selected Google Charts in the Yii 2.0 PHP Framework, like you would use a GridView.

Currently, yii2-gcharts consists of the following widgets:

A demonstration of Yii2-gcharts is here.

Installation

Install yii2-gcharts with Composer. Either add the following to the require section of your composer.json file:

"sjaakp/yii2-gcharts": "*"

Or run:

composer require sjaakp/yii2-gcharts "*"

You can manually install yii2-gcharts by downloading the source in ZIP-format.

Using yii2-gcharts

Use the yii2 charts widgets just like you would use a GridView. For instance, in the Controller you might have something like:

To render a PieChart in the View we could use:

...
<?= PieChart::widget([
    'height' => '400px',
    'dataProvider' => $dataProvider,
    'columns' => [
        'name:string',
        'population'
    ],
    'options' => [
        'title' => 'Countries by Population'
    ],
]) ?>
...

Each of the chart types has slight variations in the column interpretation, and its own set of options. Consult the Google Charts documentation.

Options

All the yii2-gcharts widgets share the same options:

dataProvider

The data provider for the chart. This property is required. In most cases, it will be an ActiveDataProvider or an ArrayDataProvider.

columns

Chart column configuration array. Each array element configures one chart column. Each column configuration is an array or a string shortcut.

An array column configuration can have the following members (all are optional, but at least one must be given):

The string shortcut configuration specifies the attribute, type, and label in the format "attribute:type:label". Both type and label are optional; they take their default values if omitted.

mode

string This determines which variant of the chart is drawn. Must be one of:

Notice that only a few of the charts are currently available in Material version and that they're in early beta, lacking lots of the 'classic' options.

Notice also that currently, the Material options are undocumented, so the only practical way to work with Material charts is using the "transition" mode.

version

string The version of the gcharts library used. Must be one of:

More information.

mapsApiKey

string Applies to GeoChart only. It is advised to provide GeoChart with an API-key of Google Maps.


All versions of yii2-gcharts with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sjaakp/yii2-gcharts contains the following files

Loading the files please wait ....