PHP code example of mobile215 / amcharts
1. Go to this page and download the library: Download mobile215/amcharts 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/ */
mobile215 / amcharts example snippets
$manager = \AmCharts\Manager::getInstance();
$manager->setAmChartsPath('./amcharts.js');
$manager->setJsIncluded(true);
$manager->setLoadJQuery(true);
$pie = new Chart\Pie();
$pie->setDataProvider(array(
array(
'name' => 'Foo',
'value' => 1
),
array(
'name' => 'Bar',
'value' => 3
),
array(
'name' => 'Baz',
'value' => 2
)
));
$pie->setTitleField('name')
->setValueField('value');
echo $pie->render();