PHPackages                             pierresh/simca - 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. [Image &amp; Media](/categories/media)
4. /
5. pierresh/simca

ActiveLibrary[Image &amp; Media](/categories/media)

pierresh/simca
==============

SVG charts for PHP

0.0.9(1mo ago)52.4k↓33.3%1MITPHPPHP &gt;=8.2

Since Jun 23Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/pierresh/simca)[ Packagist](https://packagist.org/packages/pierresh/simca)[ RSS](/packages/pierresh-simca/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (14)Versions (10)Used By (0)

[![code style: prettier](https://camo.githubusercontent.com/fa1096c501361805c36b519890a25f61cd45dde376718bb2f5af65a656f4c0fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d70726574746965722d6666363962342e7376673f7374796c653d666c61742d737175617265)](https://github.com/prettier/prettier)[![PHPStan Enabled](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/phpstan/phpstan)

Simca
=====

[](#simca)

**SVG Charts for PHP**

This project aims to be a complete solution for creating SVG charts in PHP. It is especially useful when charts need to be generated on the back-end to be included in emails and PDFs.

[![examples](app/example.png)](app/example.png)

Available Chart Types
---------------------

[](#available-chart-types)

### Bar Chart

[](#bar-chart)

- Can be stacked
- Can have a right axis with the `nbYkeys2` option

### Line Chart

[](#line-chart)

- Can be curved or straight
- Can include a time scale
- Can display objectives
- Can display events
- Can display a trend line
- Can have a right axis with the `nbYkeys2` option

### Area Chart

[](#area-chart)

Same as Line chart, just set the option `fillOpacity` to a value greater than 0 (i.e. 0.3);

### Pie Chart

[](#pie-chart)

- Can be converted to a polar pie chart by adding a coefficient (see example below)

### Bubble Chart

[](#bubble-chart)

- Can include a time scale

### Radar Chart

[](#radar-chart)

- Can be stacked

#### Other options

[](#other-options)

- `numLines` number of horizontal grid lines in the chart
- `responsive` set to `false` to disable responsive mode
- `showYAxis` set to `false` will hide the Y axis
- `unitY1` / `unitY2` units for the Y axes
- `labelAngle` to rotate the labels of the X axis

Installation
------------

[](#installation)

```
composer require pierresh\simca
```

How to use
----------

[](#how-to-use)

Example to generate a SVG chart:

```
use Pierresh\Simca\Charts\BarChart;

$chart = (new BarChart(600, 400))
	->setSeries([[10, 45, 30, 25], [15, 20, 15, 25], [5, 2, 10, 15]])
	->setLabels(['A', 'B', 'C', 'D'])
	->setColors(['#2dd55b', '#ffc409', '#0054e9'])
	->setOptions([
		'stacked' => true,
		'nbYkeys2' => 1,
	])
	->render();
```

```
use Pierresh\Simca\Charts\LineChart;

$chart = (new LineChart(600, 400))
	->setSeries([[10, 45, 30, 25], [15, 20, 15, 25]])
	->setLabels(['2024-06-01 08:00', '2024-06-01 09:00', '2024-06-01 13:00', '2024-06-01 13:30'])
	->addObjectiveY1(20)
	->addEvent('2024-06-01 10:00')
	->addEvent('2024-06-01 12:15')
	->showTrend()
	->setOptions([
		'timeChart' => true,
		'unitY1' => 'T',
		'nbYkeys2' => 1,
	])
	->render();
```

```
use Pierresh\Simca\Charts\PieChart;

// The secondary value is an optional coefficient for polar pie chart
$chart = (new PieChart(400, 400))->setSeries([[14, 0.5], [3, 0.9], [5, 0.8], [5, 1], [5, 0.9]])->render();
```

```
use Pierresh\Simca\Charts\BubbleChart;

$chart = (new BubbleChart(600, 400))
	->setSeries([['2024-06-01 08:00', 40, 30], ['2024-06-01 09:00', 20, 15], ['2024-06-01 12:00', 30, 25]])
	->setOptions([
		'timeChart' => true,
	])
	->render();
```

```
use Pierresh\Simca\Charts\RadarChart;

$chart = (new RadarChart(600, 400))
	->setSeries([[65, 59, 90, 81, 56, 55, 40], [38, 48, 40, 19, 96, 27, 100]])
	->setLabels(['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'])
	->setOptions([
		'fillOpacity' => 0.3,
	])
	->render();
```

Alternatively, you can replace `render()` with `renderBase64()` to get a base64 encoded SVG image.

Development
-----------

[](#development)

Clone the repository and install the dependencies:

```
git clone https://github.com/pierresh/simca

cd simca

composer install
npm install
```

There is a watcher script to automatically refresh the page when a change is made.

You will need to install [BrowserSync](https://browsersync.io/) first:

```
npm install -g browser-sync
```

Then the example page can be run with the following command:

```
./watcher.sh ./app/index.php
```

🧹 Reformat using **Prettier**

```
composer format
```

✨ Run refactors using **Rector**

```
composer refactor
```

⚗️ Run static analysis using **PHPStan**:

```
composer stan
```

✅ Run unit tests using **PEST**

```
composer test
```

🚀 Run the entire quality suite:

```
composer quality
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance72

Regular maintenance activity

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Every ~79 days

Recently: every ~105 days

Total

9

Last Release

57d ago

PHP version history (2 changes)0.0.1PHP &gt;=8.1

0.0.5PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7520095?v=4)[Pierre](/maintainers/pierresh)[@pierresh](https://github.com/pierresh)

---

Top Contributors

[![moebrowne](https://avatars.githubusercontent.com/u/8448512?v=4)](https://github.com/moebrowne "moebrowne (4 commits)")[![pierresh](https://avatars.githubusercontent.com/u/7520095?v=4)](https://github.com/pierresh "pierresh (4 commits)")

---

Tags

chartphpsvgsvgchartcharts

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pierresh-simca/health.svg)

```
[![Health](https://phpackages.com/badges/pierresh-simca/health.svg)](https://phpackages.com/packages/pierresh-simca)
```

###  Alternatives

[picqer/php-barcode-generator

An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.

1.8k25.5M88](/packages/picqer-php-barcode-generator)[lasserafn/php-initial-avatar-generator

A package to generate avatars with initials for PHP

4374.2M13](/packages/lasserafn-php-initial-avatar-generator)[yzalis/identicon

Generate unique identicon avatars from any string

5901.1M21](/packages/yzalis-identicon)[ianw/quickchart

QuickChart chart API

46638.6k](/packages/ianw-quickchart)[szymach/c-pchart

Port of "pChart" library into PHP 8+

1512.3M7](/packages/szymach-c-pchart)[jkphl/iconizr

A PHP command line tool for converting SVG images to a set of CSS icons (SVG &amp; PNG, single icons and / or CSS sprites) with support for image optimization and Sass output

4869.0k](/packages/jkphl-iconizr)

PHPackages © 2026

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