2017 © Pedro Peláez
 

library highroller-zf2

Highcharts module for Zend Framework 2 based on HighRoller.

image

jfloff/highroller-zf2

Highcharts module for Zend Framework 2 based on HighRoller.

  • Thursday, October 9, 2014
  • by jfloff
  • Repository
  • 4 Watchers
  • 20 Stars
  • 804 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

I'm discontinuing this project in favor of more flexible approaches. For my own projects I've switched to HighchartsPHP with ease. I recommend you to also make the switch, since I won't be updating this packages with new features. Thank you all for your support!

HighRoller for Zend Framework 2

Package of Highroller by @jmaclabs ready for Zend Framework 2 integration via Composer., (*1)

Introduction

HighRoller is an object-oriented PHP Wrapper for the Highcharts JavaScript Library. HighRoller gets Highcharts up and running in your PHP project fast. * HighRoller Home Page * Gravity Home Page * Highcharts Home Page, (*2)

Installation

Main Setup

With composer

  1. Require this project using composer:, (*3)

    ./composer.phar require jfloff/highroller-zf2:dev-master
    

Post installation

Enabling it in your application.config.phpfile., (*4)

```php
<?php
return array(
    'modules' => array(
        // ...
        'HighRoller',
        'AssetManager',
    ),
    // ...
);
```

Quick-Guide for ZF2 Skeleton Application

In this quick guide, we will place a very humble line chart in the ZF2 Skeleton Application. Before starting make sure you are using a clean ZF2 Skeleton Application, and that you already set up highroller-zf2 using the instructions above., (*5)

Open module/Application/src/Application/Controller/IndexController.php., (*6)

  1. Include HighRoller files:, (*7)

    use HighRoller\LineChart;
    use HighRoller\SeriesData;
    
  2. Inside indexAction function create a new line chart:, (*8)

    $linechart = new LineChart();
    $linechart->title->text = 'Line Chart';
    
    $series = new SeriesData();
    $series->name = 'myData';
    
    $chartData = array(5324, 7534, 6234, 7234, 8251, 10324);
    foreach ($chartData as $value)
        $series->addData($value);
    
    $linechart->addSeries($series);
    
  3. Pass the your HighRoller object $linechart to the view:, (*9)

    return new ViewModel(array('highroller' => $linechart));
    

Open module/Application/view/application/index/index.phtml, (*10)

  1. Include highcharts.js file (you could also do this in your layout):, (*11)

    <script src="http://code.highcharts.com/highcharts.js"></script>
    <script src="http://code.highcharts.com/modules/exporting.js"></script>
    
  2. At the top of the file:, (*12)

    • Add a HTML div where your chart will be rendered to,
    • Set the div id in the HighRoller object,
    • Finally append the render script.
    <div id="highroller"></div>
    <?php
        $this->highroller->chart->renderTo = "highroller";
        $this->headScript()->appendScript($this->highroller->renderChart());
    ?>
    
  3. You should now see a beautiful simple line chart in your main page, just like this one:, (*13)

linechart, (*14)

Licensing

HighRoller is licensed by Gravity.com under the Apache 2.0 license, see the LICENSE file for more details., (*15)

HighCharts is licensed by Highsoft Solutions AS., (*16)

Highcharts is licensed for free for any personal or non-profit projects under the [Creative Commons Attribution-NonCommercial 3.0 License] (http://creativecommons.org/licenses/by-nc/3.0/)., (*17)

See the license and pricing details directly on the Highcharts.com site for more details., (*18)

The Versions

09/10 2014

dev-master

9999999-dev https://github.com/jfloff/highroller-zf2

Highcharts module for Zend Framework 2 based on HighRoller.

  Sources   Download

Apache-2.0

The Requires

 

zf2 highcharts zend framework 2 highroller

24/04 2014

1.1.1

1.1.1.0 https://github.com/jfloff/highroller-zf2

Highcharts module for Zend Framework 2 based on HighRoller.

  Sources   Download

Apache-2.0

The Requires

 

zf2 highcharts zend framework 2 highroller

23/04 2014

1.1.0

1.1.0.0 https://github.com/jfloff/highroller-zf2

Highcharts module for Zend Framework 2 based on HighRoller.

  Sources   Download

Apache-2.0

The Requires

 

zf2 highcharts zend framework 2 highroller

06/02 2013

1.0.1

1.0.1.0 https://github.com/jfloff/highroller-zf2

Highcharts module for Zend Framework 2 based on HighRoller.

  Sources   Download

Apache-2.0

The Requires

 

zf2 highcharts zend framework 2 highroller

20/01 2013

1.0.0

1.0.0.0 https://github.com/jfloff/highroller-zf2

Highcharts module for Zend Framework 2 based on HighRoller.

  Sources   Download

Apache-2.0

The Requires

 

zf2 highcharts zend framework 2 highroller