2017 © Pedro Peláez
 

library phighcharts

A PHP library for the Highcharts JavaScript charting library

image

catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  • Monday, April 27, 2015
  • by catchamonkey
  • Repository
  • 2 Watchers
  • 27 Stars
  • 2,721 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 2 Open issues
  • 14 Versions
  • 1 % Grown

The README.md

Phighcharts Project Build Status SensioLabsInsight

A PHP (Requires PHP 5.3) library for the Highcharts JavaScript charting library, (*1)

Installation

composer require "catchamonkey/phighcharts"

What does it do?

Along with providing a nice OO interface to create your charts, it also extends the functionality by adding such useful tools as "Sticky Keys", (*2)

Sticky Keys

A sticky key, is a configuration option that allows you to always use the same colour for certain keys. For example, you may want to always use green for apples when charting apples vs oranges., (*3)

Example Pie Chart

setStickyColour('apples', '#629632');
    $extOptions->setStickyColour('oranges', '#CD3700');

    $options = new Container('chart');
    $options->setRenderTo('chart_example_59');
    $options->setMarginRight(130);
    $options->setMarginBottom(25);

    $titleOptions = new Container('title');
    $titleOptions->setText('Monthly Details');
    $titleOptions->setX(-20);

    $data = new Data();
    $data
        ->addCount('Apples', 32)
        ->addCount('Oranges', 68)
        ->addSeries('Apples', array(
            '2012-05-01' => 12,
            '2012-05-02' => 3,
            '2012-05-03' => 33
        ))
        ->addSeries('Oranges', array(
            '2012-05-01' => 32,
            '2012-05-02' => 36,
            '2012-05-03' => 18
        ));

    // put it all together
    $chart  = new Chart();
    $chart
        ->addOptions($options)
        ->addOptions($titleOptions)
        ->addOptions($extOptions)
        ->setData($data)
        ->setRenderer(new Pie());

    // a line chart is similar, and our data container holds series data for this
    $lineChart = clone $chart;
    $options = new Container('chart');
    $options->setRenderTo('chart_example_60');
    $options->setMarginRight(130);
    $options->setMarginBottom(25);
    $lineChart->addOptions($options)->setRenderer(new Line());

    // and render in the template
    $chart->renderContainer();
    // or to change the element rendered
    // $chart->renderContainer('span');
    $chart->render();

    // and for the line
    $lineChart->renderContainer();
    $lineChart->render();
?>

for rendering the labels as datetime format, provide an instance of the format class. Note: Phighchart uses the Linear format by default, (*4)

setFormat($dateTimeFormat);

?>

The Datetime formatter will now attempt to parse the chart data keys as DateTime objects. The Datetime format class can parse the standard PHP date time string formats out-of-the-box., (*5)

See - http://no2.php.net/manual/en/datetime.formats.compound.php - http://no2.php.net/manual/en/datetime.formats.date.php, (*6)

For parsing custom date time string formats, provide the datetime string pattern to the Phighchart Datetime format class as follows:, (*7)

setDateTimeFormat('jS F, Y H:i:s');
    $chart->setFormat($dateTimeFormat);

?>

Unit Tests

You can run the Unit Test suite with;, (*8)

phpunit -c . tests/

The Versions

27/04 2015

dev-master

9999999-dev http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

07/05 2013

v0.1.3

0.1.3.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

22/01 2013

v0.1.2

0.1.2.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

14/11 2012

v0.1.1

0.1.1.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

14/11 2012

dev-cs_fixes

dev-cs_fixes http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

30/08 2012

v0.1.0

0.1.0.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

02/07 2012

v0.0.8

0.0.8.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

26/06 2012

v0.0.7

0.0.7.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

08/06 2012

v0.0.6

0.0.6.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

31/05 2012

v0.0.5

0.0.5.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

29/05 2012

v0.0.4

0.0.4.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

18/05 2012

v0.0.3

0.0.3.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

18/05 2012

v0.0.2

0.0.2.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting

17/05 2012

v0.0.1

0.0.1.0 http://github.com/catchamonkey/phighcharts

A PHP library for the Highcharts JavaScript charting library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

wrapper chart highcharts charting