PHP code example of neeckeloo / amcharts-php

1. Go to this page and download the library: Download neeckeloo/amcharts-php 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/ */

    

neeckeloo / amcharts-php example snippets



$manager = \AmCharts\Manager::getInstance();
$manager->setAmChartsPath('./amcharts.js');


$pie = new \AmCharts\Chart\Pie();
$pie->setDataProvider(array(
    array(
        'name' => 'Foo',
        'value' => 1
    ),
    array(
        'name' => 'Bar',
        'value' => 3
    ),
    array(
        'name' => 'Baz',
        'value' => 2
    )
));
$pie->fields()->setTitleField('name')
    ->setValueField('value');

echo $pie->render();