PHP code example of jfloff / highroller-zf2

1. Go to this page and download the library: Download jfloff/highroller-zf2 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jfloff / highroller-zf2 example snippets


    
    return array(
        'modules' => array(
            // ...
            'HighRoller',
            'AssetManager',
        ),
        // ...
    );
    

    use HighRoller\LineChart;
    use HighRoller\SeriesData;
    

    $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);
    

    return new ViewModel(array('highroller' => $linechart));
    
phtml
    <div id="highroller"></div>
    
        $this->highroller->chart->renderTo = "highroller";
        $this->headScript()->appendScript($this->highroller->renderChart());