PHP code example of daixianceng / yii2-echarts

1. Go to this page and download the library: Download daixianceng/yii2-echarts 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/ */

    

daixianceng / yii2-echarts example snippets



use yii\web\JsExpression;
use daixianceng\echarts\ECharts;


use daixianceng\echarts\ECharts;

// Registers the theme JS files.
ECharts::registerTheme('dark');


use daixianceng\echarts\ECharts;

// 引用地图必须使用完整版的echarts
ECharts::$dist = ECharts::DIST_FULL;
ECharts::registerMap(['china', 'province/beijing']);


return [
    'components' => [
        'assetManager' => [
            'class' => 'yii\web\AssetManager',
            'bundles' => [
                'daixianceng\echarts\EChartsAsset' => [
                    'sourcePath' => null,
                    'baseUrl' => 'https://cdn.jsdelivr.net/npm/[email protected]/dist'
                ]
            ],
        ],
    ],
];

php composer.phar