Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phplot Bundle Laravel Package

davefx/phplot-bundle

View on GitHub
Deep Wiki
Context7

DaveFXPHPlotBundle

Symfony2 bundle for PHPlot - Graph library for charts.

Requirements

Installation (Composer)

0. Install Composer

If you don't have Composer yet, download it following the instructions on http://getcomposer.org/ or just run the following command:

curl -s http://getcomposer.org/installer | php

1. Add the davefx/phplot-bundle package and the phplot repository in your composer.json

{
    "require": {
        "davefx/phplot-bundle": "dev-master"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update noiselabs/nusoap-bundle

Composer will install the bundle to your project's vendor/noiselabs directory.

2. Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new DaveFX\Bundle\PHPlotBundle\DaveFXPHPlotBundle(),
    );
}

Usage

/* ExampleController.php */

namespace ACME\ExampleBundle\Controller;
 
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

function generateExampleChartAction()
{
    $data = array(
      array('', 1800,   5), array('', 1810,   7), array('', 1820,  10),
      array('', 1830,  13), array('', 1840,  17), array('', 1850,  23),
      array('', 1860,  31), array('', 1870,  39), array('', 1880,  50),
      array('', 1890,  63), array('', 1900,  76), array('', 1910,  92),
      array('', 1920, 106), array('', 1930, 123), array('', 1940, 132),
      array('', 1950, 151), array('', 1960, 179), array('', 1970, 203),
      array('', 1980, 227), array('', 1990, 249), array('', 2000, 281),
    );
    
    $plot = new \PHPlot(800,600);
    
    $plot->SetImageBorderType('plain');
    
    $plot->SetPlotType('lines');
    $plot->SetDataType('data-data');
    $plot->SetDataValues($data);
    
    # Main plot title:
    $plot->SetTitle('US Population, in millions');
    
    # Make sure Y axis starts at 0:
    $plot->SetPlotAreaWorld(NULL, 0, NULL, NULL);
    
    ob_start();
    $plot->DrawGraph();
    $str = ob_get_clean();
    
    return new Response($str, 200, array("Content-type: image/png"));
}

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed