gufy/google-charts

There is no license information available for the latest version (dev-master) of this package.

dev-master 2014-07-22 03:15 UTC

This package is auto-updated.

Last update: 2024-04-13 17:14:43 UTC


README

This package will give you an easy way to create a chart with Google Charts.

Build Status Coverage Status Total Downloads Latest Stable Version

Installation

Run this to install on your current project

$ composer require gufy/google-charts:dev-master 

Or you can add this package to your composer.json file:

"require": {
	"gufy/google-charts": "dev-master"
}

Use composer to install this package.

$ composer update

Configuration

Registering the Package

register this service provider at the bottom of the $providers array: app.php

'Gufy\GoogleCharts\GoogleChartsServiceProvider'

Usage

Chart Class in this package

Here is the list of Chart you can use.

  • Area Chart
  • Bar Chart
  • Bubble Chart
  • Line Chart

It will update continuously until every chart on Google Chart API covered.

Basic usage

Before you go, please add this on your layouts to make sure everything is works. In this package, it doesn't include the script URL.

<script type="text/javascript" src="https://www.google.com/jsapi"></script>

Creating An Area Chart

<?php

// set some of options
$options = [
	'xAxis'=>[
		'title'=>'Discovery Channels'
	]
];
$chart = Area::setOptions($options);

// create columns
$chart->setColumns([
	'Year',
	'Extinction Growth'
]);

// set some data
$chart->setData([
	['2010', 15000],
	['2011', 14037],
	['2012', 16021],
	['2013', 13520],
]);

// run this on your view
$chart->render();

For reference on Google Charts API please follow https://developers.google.com/chart

Contribution Guide

Just do as usual, fork and create your own code. And then pull request.