{"id":36399272,"url":"https://github.com/pierresh/simca","last_synced_at":"2026-05-21T07:20:15.810Z","repository":{"id":244500221,"uuid":"815426805","full_name":"pierresh/simca","owner":"pierresh","description":"Simple SVG charts for PHP","archived":false,"fork":false,"pushed_at":"2025-08-31T12:59:49.000Z","size":630,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T04:25:55.646Z","etag":null,"topics":["chart","php","svg"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/pierresh/simca","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pierresh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-15T06:08:02.000Z","updated_at":"2025-09-23T05:27:16.000Z","dependencies_parsed_at":"2024-06-15T07:25:40.927Z","dependency_job_id":"cb322732-bd05-4cf6-97e5-84d230a4cf9c","html_url":"https://github.com/pierresh/simca","commit_stats":null,"previous_names":["pierresh/simca"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pierresh/simca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresh%2Fsimca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresh%2Fsimca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresh%2Fsimca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresh%2Fsimca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pierresh","download_url":"https://codeload.github.com/pierresh/simca/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresh%2Fsimca/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28312142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chart","php","svg"],"created_at":"2026-01-11T16:01:42.479Z","updated_at":"2026-01-11T16:01:47.687Z","avatar_url":"https://github.com/pierresh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![PHPStan Enabled](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)\n\n# Simca\n\n**SVG Charts for PHP**\n\nThis 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.\n\n![examples](app/example.png)\n\n## Available Chart Types\n\n### Bar Chart\n\n- Can be stacked\n- Can have a right axis with the `nbYkeys2` option\n\n### Line Chart\n\n- Can be curved or straight\n- Can include a time scale\n- Can display objectives\n- Can display events\n- Can display a trend line\n- Can have a right axis with the `nbYkeys2` option\n\n### Area Chart\n\nSame as Line chart, just set the option `fillOpacity` to a value greater than 0 (i.e. 0.3);\n\n### Pie Chart\n\n- Can be converted to a polar pie chart by adding a coefficient (see example below)\n\n### Bubble Chart\n\n- Can include a time scale\n\n### Radar Chart\n\n- Can be stacked\n\n#### Other options\n\n- `numLines` number of horizontal grid lines in the chart\n- `responsive` set to `false` to disable responsive mode\n- `showYAxis` set to `false` will hide the Y axis\n- `unitY1` / `unitY2` units for the Y axes\n- `labelAngle` to rotate the labels of the X axis\n\n## Installation\n\n```php\ncomposer require pierresh\\simca\n```\n\n## How to use\n\nExample to generate a SVG chart:\n\n```php\nuse Pierresh\\Simca\\Charts\\BarChart;\n\n$chart = (new BarChart(600, 400))\n\t-\u003esetSeries([[10, 45, 30, 25], [15, 20, 15, 25], [5, 2, 10, 15]])\n\t-\u003esetLabels(['A', 'B', 'C', 'D'])\n\t-\u003esetColors(['#2dd55b', '#ffc409', '#0054e9'])\n\t-\u003esetOptions([\n\t\t'stacked' =\u003e true,\n\t\t'nbYkeys2' =\u003e 1,\n\t])\n\t-\u003erender();\n```\n\n```php\nuse Pierresh\\Simca\\Charts\\LineChart;\n\n$chart = (new LineChart(600, 400))\n\t-\u003esetSeries([[10, 45, 30, 25], [15, 20, 15, 25]])\n\t-\u003esetLabels(['2024-06-01 08:00', '2024-06-01 09:00', '2024-06-01 13:00', '2024-06-01 13:30'])\n\t-\u003eaddObjectiveY1(20)\n\t-\u003eaddEvent('2024-06-01 10:00')\n\t-\u003eaddEvent('2024-06-01 12:15')\n\t-\u003eshowTrend()\n\t-\u003esetOptions([\n\t\t'timeChart' =\u003e true,\n\t\t'unitY1' =\u003e 'T',\n\t\t'nbYkeys2' =\u003e 1,\n\t])\n\t-\u003erender();\n```\n\n```php\nuse Pierresh\\Simca\\Charts\\PieChart;\n\n// The secondary value is an optional coefficient for polar pie chart\n$chart = (new PieChart(400, 400))-\u003esetSeries([[14, 0.5], [3, 0.9], [5, 0.8], [5, 1], [5, 0.9]])-\u003erender();\n```\n\n```php\nuse Pierresh\\Simca\\Charts\\BubbleChart;\n\n$chart = (new BubbleChart(600, 400))\n\t-\u003esetSeries([['2024-06-01 08:00', 40, 30], ['2024-06-01 09:00', 20, 15], ['2024-06-01 12:00', 30, 25]])\n\t-\u003esetOptions([\n\t\t'timeChart' =\u003e true,\n\t])\n\t-\u003erender();\n```\n\n```php\nuse Pierresh\\Simca\\Charts\\RadarChart;\n\n$chart = (new RadarChart(600, 400))\n\t-\u003esetSeries([[65, 59, 90, 81, 56, 55, 40], [38, 48, 40, 19, 96, 27, 100]])\n\t-\u003esetLabels(['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'])\n\t-\u003esetOptions([\n\t\t'fillOpacity' =\u003e 0.3,\n\t])\n\t-\u003erender();\n```\n\nAlternatively, you can replace `render()` with `renderBase64()` to get a base64 encoded SVG image.\n\n## Development\n\nClone the repository and install the dependencies:\n\n```bash\ngit clone https://github.com/pierresh/simca\n\ncd simca\n\ncomposer install\nnpm install\n```\n\nThere is a watcher script to automatically refresh the page when a change is made.\n\nYou will need to install [BrowserSync](https://browsersync.io/) first:\n\n```bash\nnpm install -g browser-sync\n```\n\nThen the example page can be run with the following command:\n\n```bash\n./watcher.sh ./app/index.php\n```\n\n🧹 Reformat using **Prettier**\n\n```bash\ncomposer format\n```\n\n✨ Run refactors using **Rector**\n\n```bash\ncomposer refactor\n```\n\n⚗️ Run static analysis using **PHPStan**:\n\n```bash\ncomposer stan\n```\n\n✅ Run unit tests using **PEST**\n\n```bash\ncomposer test\n```\n\n🚀 Run the entire quality suite:\n\n```bash\ncomposer quality\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierresh%2Fsimca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierresh%2Fsimca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierresh%2Fsimca/lists"}