PHPackages                             rockyangs/php-chart - 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. rockyangs/php-chart

ActiveLibrary

rockyangs/php-chart
===================

A PHP chart library, implemented 2D / 3D broken line chart, bar chart, pie chart etc.

v1.0.0(6y ago)328MITPHPPHP &gt;=5.3.0

Since Apr 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/yangjian102621/php-chart)[ Packagist](https://packagist.org/packages/rockyangs/php-chart)[ Docs](https://gitee.com/blackfox/php-chart)[ RSS](/packages/rockyangs-php-chart/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

php-chart
=========

[](#php-chart)

一个 PHP 图表生成工具，开箱即用，生成各种折线图，2D/3D 饼状图，条形图等。

如何使用
----

[](#如何使用)

```
composer install rockyangs/php-chart
```

Sample code
-----------

[](#sample-code)

```
require_once("./vendor/autoload.php");

$data = array(
    '2005'  => '60',
    '2006' 	=> '90',
    '2007'  => '120',
    '2008'  => '160',
    '2009'  => '240',
    '2010'  => '300',
    '2011'  => '320',
    '2012'  => '400',
    '2013'	=> '540'
);
//Y坐标抽参数 步长 => 点数
$axisy = array(100, 6);
$config = array(
    'data' 	=> $data,
    'axisy' => $axisy,
    'title' => 'Sample Broken Line Chart',
    'unit' => 'IP/次',
    't_fsize' => 18,
    't_font' => 0,
    'bg_size' => array(800, 600)
);

$chart = ChartFactory::create(BrokenChart::class, $config);
// show image in browser
$chart->showChart();
// save image to file
$chart->saveChart("{$dir}/broken-chart.png", 'png');
```

效果预览
----

[](#效果预览)

### 折线图

[](#折线图)

[![折线图](image/broken-chart.png)](image/broken-chart.png)

### 饼状图

[](#饼状图)

[![饼状图](image/pie-chart.png)](image/pie-chart.png)

### 条形图

[](#条形图)

[![条形图](image/square-2D-chart.png)](image/square-2D-chart.png)

[![条形图](image/square-3D-chart.png)](image/square-3D-chart.png)

[![条形图](image/circle-3D-chart.png)](image/circle-3D-chart.png)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

2225d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89a29c7b39db881dd1e2628fa60c40bc80a32c2de700b7aedf18c87fad3eca04?d=identicon)[yangjian102621](/maintainers/yangjian102621)

---

Top Contributors

[![yangjian102621](https://avatars.githubusercontent.com/u/4746061?v=4)](https://github.com/yangjian102621 "yangjian102621 (8 commits)")

---

Tags

php chart

### Embed Badge

![Health badge](/badges/rockyangs-php-chart/health.svg)

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

PHPackages © 2026

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