2017 © Pedro Peláez
 

library google-chart-wrapper

A PHP wrapper on top of http://chart.apis.google.com/chart

image

ipmedia/google-chart-wrapper

A PHP wrapper on top of http://chart.apis.google.com/chart

  • Thursday, August 11, 2016
  • by capir
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GoogleChartWrapper

Build Status, (*1)

Introduction

GoogleChartWrapper is a quick clean api over the Google Image Chart Service., (*2)

Warning: This API is deprecated., (*3)

Although the API is deprecated and it can be turned off without notice, its still a great choice when you have to quickly generate chats for email reports. Feel free to imporove it as you like., (*4)

Instalation

composer require ipmedia/google-chart-wrapper

Usage


use \IpMedia\GoogleChartWrapper; // instantiate wrapper $wrapper = new GoogleChartWrapper; // set the data to be rendered $wrapper->setData([ 5, 2, 3 ]); // render the link to the google api generator $wrapper->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:5,2,3 // change the type of the chart $wrapper->setType(GoogleChartWrapper::PIE)->getSrc(); // http://chart.apis.google.com/chart?cht=p&chs=450x200&chd=t:5,2,3 // set the size of the chart $wrapper->setSize(200, 200)->$this->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=200x200&chd=t:5,2,3 // set the base color $wrapper->setBaseColor('00ffff')->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:5,2,3&chco=00ffff // rgb supported $wrapper->setBaseColor([ 0, 255, 255 ])->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:5,2,3&chco=00ffff // set the base color $wrapper->setGradientColor([ 0, 0, 0 ], [ 255, 255, 255 ])->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:5,2,3&chco=000000,ffffff // or set a color for each segment $this->setColors([ [ 255, 0, 0 ], [ 0, 255, 0 ], [ 0, 0, 255 ] ])->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:5,2,3&chco=ff0000|00ff00|0000ff // add labels $wrapper->setLabels([ 'Five', 'Two', 'Four' ])->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:5,2,3&chl=Five|Two|Four // and finally you can set the labels of the chart $wrapper->setTitle('Chart Title')->getSrc(); // http://chart.apis.google.com/chart?cht=p3&chs=450x200&chd=t:5,2,3&chtt=Chart+Title

License

GoogleChartWrapper is open-sourced software licensed under the MIT license., (*5)

The Versions

11/08 2016

dev-master

9999999-dev

A PHP wrapper on top of http://chart.apis.google.com/chart

  Sources   Download

The Development Requires

by Catalin Pirvu

11/08 2016

1.0.0

1.0.0.0

A PHP wrapper on top of http://chart.apis.google.com/chart

  Sources   Download

The Development Requires

by Catalin Pirvu