PHP code example of clesson-de / silverstripe-graphing
1. Go to this page and download the library: Download clesson-de/silverstripe-graphing 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/ */
clesson-de / silverstripe-graphing example snippets
declare(strict_types=1);
namespace App\Forms;
use Clesson\Silverstripe\Graphing\Forms\ChartField;
class DoughnutChartField extends ChartField
{
public function getChartType(): string
{
return 'doughnut';
}
}
public function getChartConfig(): array
{
$config = parent::getChartConfig();
foreach ($config['data']['datasets'] as &$dataset) {
if (!isset($dataset['borderWidth'])) {
$dataset['borderWidth'] = 2;
}
}
return $config;
}
/dev/build?flush=all
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.