PHPackages                             youyiio/php-echarts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. youyiio/php-echarts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

youyiio/php-echarts
===================

php-echarts is a php library for the echarts 5.0

v0.2.1(4y ago)61.7k↓50%[3 issues](https://github.com/youyiio/php-echarts/issues)1Apache-2.0PHPPHP &gt;=5.6.0

Since Sep 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/youyiio/php-echarts)[ Packagist](https://packagist.org/packages/youyiio/php-echarts)[ Docs](https://www.beyongx.com)[ RSS](/packages/youyiio-php-echarts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (1)

php-echarts
===========

[](#php-echarts)

**一款支持Apache EChart5.0+图表的php开发库** 优先ThinkPHP5/6的开发及测试。

Apache EChart5.0已经最新发布，在视觉效果、动画效果和大数据展示方面已经远超之前的版本； 故不考虑EChart5.0之前版本的兼容问题；建议直接尝试5.0+

目录
--

[](#目录)

- \[第一个EChart5.0 demo\](#第一个EChart5.0 demo)
- [安装](#%E5%AE%89%E8%A3%85)
    - [使用 Composer 安装 (强烈推荐)](#%E4%BD%BF%E7%94%A8-composer-%E5%AE%89%E8%A3%85-%E5%BC%BA%E7%83%88%E6%8E%A8%E8%8D%90)
    - [github下载 或 直接手动下载源码](#github%E4%B8%8B%E8%BD%BD-%E6%88%96-%E7%9B%B4%E6%8E%A5%E6%89%8B%E5%8A%A8%E4%B8%8B%E8%BD%BD%E6%BA%90%E7%A0%81)
        - [下载文件](#%E4%B8%8B%E8%BD%BD%E6%96%87%E4%BB%B6)
        - [引入自动载入文件](#%E5%BC%95%E5%85%A5%E8%87%AA%E5%8A%A8%E8%BD%BD%E5%85%A5%E6%96%87%E4%BB%B6)

第一个EChart5.0 demo
-----------------

[](#第一个echart50-demo)

**ThinkPHP5/6 示例**

```
use beyong\echarts\ECharts;
use beyong\echarts\options\YAxis;
use beyong\echarts\Option;
use beyong\echarts\charts\Bar;

$echarts = ECharts::init("#myChart");

$option = new Option();
$option->title(['text' => 'ECharts 入门示例']);
$option->xAxis(["data" => ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']]);
$option->yAxis([]);

$chart = new Bar();
$chart->data = [5, 20, 36, 10, 10, 20];
$option->addSeries($chart);

$echarts->option($option);

$content = $echarts->render();
echo $content;

```

安装
--

[](#安装)

### 使用 Composer 安装 (强烈推荐):

[](#使用-composer-安装-强烈推荐)

支持 `psr-4` 规范, 开箱即用

```
composer require youyiio/php-echarts

```

### github下载 或 直接手动下载源码:

[](#github下载-或-直接手动下载源码)

需手动引入自动载入文件

#### 下载文件:

[](#下载文件)

git clone  php-echarts

#### 引入自动载入文件:

[](#引入自动载入文件)

使用时引入或者全局自动引入

`require_once '/path/to/php-echarts/src/autoload.php`;

示例 - Line
---------

[](#示例---line)

```
$echarts = ECharts::init("#myChart");

$option = new Option();
$option->title(['text' => 'ECharts 入门示例']);
$option->xAxis(["data" => ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']]);
$option->yAxis([]);

$chart = new Line();
$chart["data"] = [5, 20, 36, 10, 10, 20];
$option->series([$chart]);

$echarts->option($option);

$content = $echarts->render();
echo $content;

```

示例 - Bar
--------

[](#示例---bar)

```
$echarts = ECharts::init("#myChart");

$option = new Option();
$option->title(['text' => 'ECharts 入门示例']);
$option->xAxis(["data" => ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']]);
$option->yAxis([]);
$option->legend(["data" => ['销量']]); //显示指定的series的标记，对应chart->name

$chart = new Bar();
$chart->name = '销量';
$chart->data = [5, 20, 36, 10, 10, 20];
$option->addSeries($chart);

$echarts->option($option);

$content = $echarts->render();
echo $content;

```

Issues
------

[](#issues)

如果有遇到问题请提交 [issues](https://github.com/youyiio/php-echarts/issues)

License
-------

[](#license)

Apache 2.0

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

1699d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0eb11d31135ed8017f5ff6b9decccf7d0cff9cf2a665ae973e5beffb032bad48?d=identicon)[cattong](/maintainers/cattong)

---

Tags

phpjavascriptchartthinkphpechartsecharts5

### Embed Badge

![Health badge](/badges/youyiio-php-echarts/health.svg)

```
[![Health](https://phpackages.com/badges/youyiio-php-echarts/health.svg)](https://phpackages.com/packages/youyiio-php-echarts)
```

###  Alternatives

[hisune/echarts-php

A php wrapper for echarts javascript libraries

327201.9k5](/packages/hisune-echarts-php)[xiaodi/think-pullword

ThinkPHP 分词/抽词 扩展包

5512.1k](/packages/xiaodi-think-pullword)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
