Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Svg Charts Laravel Package

dpodsiadlo/svg-charts

SVG Charts is a Laravel/PHP package for generating lightweight, scalable SVG charts server-side without JavaScript. Use a simple API to add clean visuals to dashboards, reports, emails, and PDFs.

View on GitHub
Deep Wiki
Context7

SVG Charts generator for DOMPDF

Frequently asked questions about Svg Charts
How do I install dpodsiadlo/svg-charts in a Laravel app?
Install it with Composer by running composer require dpodsiadlo/svg-charts. Laravel package auto-discovery registers the service provider, so no manual provider entry is normally needed. After that you can use the package's fluent API to build a chart and get an SVG string back. Confirm the package's composer.json constraints against your locked PHP and Laravel versions before adopting it.
Does svg-charts require Node.js or a headless browser?
No. SVG Charts renders charts server-side in PHP and returns an SVG string, so there is no JavaScript runtime, no Node.js build step, and no headless browser involved. That makes it a good fit for queued report generation, email digests, and PDF pipelines where a browser dependency would be operationally expensive. The tradeoff is static output, not interactive charts.
Which PHP and Laravel versions does svg-charts support?
The v1.0.5 fix for implicit conversion suggests active handling of PHP 8.1+ deprecation behaviour, but the exact supported matrix is not spelled out in the overview. Check the package's composer.json for the PHP and Laravel constraints before adopting it. Test the install on a feature branch against your locked versions rather than assuming compatibility.
What chart types can I generate with svg-charts?
The overview describes a thin Laravel-facing wrapper around an underlying SVG chart library and does not enumerate supported chart types. Bar, line, and pie are the typical baseline for server-side SVG generators, but verify the current list in the package README or source before committing to feature parity. If you need custom renderers, confirm whether an extension point exists.
How do I embed an svg-charts chart in a DomPDF PDF?
Generate the chart with the package's builder API, then inline the resulting SVG markup into the HTML you pass to barryvdh/laravel-dompdf. Because the package was built for DOMPDF, that is the intended target, but DomPDF's SVG support is weaker than Chromium-based renderers, so validate the output in the actual PDF engine rather than only in a browser. Keep the SVG simple and avoid heavy filters or complex gradients to reduce rendering surprises.
Can I use svg-charts in Blade views or HTML emails?
Yes. The package returns an SVG string, so you can echo it into a Blade template or embed it in an HTML email body. For emails, note that many clients, notably Outlook, have poor inline SVG support, so a PNG fallback or hosted image may still be needed. For server-rendered dashboards in the browser, inline SVG works well.
Is svg-charts safe for user-supplied chart labels and data?
The overview does not document an escaping policy, so treat labels and data derived from tenant-supplied content as untrusted. If you inline the SVG into HTML, escape text values before they reach the chart builder and avoid injecting raw user input into attributes. Since SVG can carry scripts and event handlers, sanitise or whitelist any user-controlled strings. Add a test that feeds hostile labels and asserts they are encoded.
How does svg-charts perform with large datasets?
There is no documented performance envelope in the overview, so benchmark with a representative series count and point count before relying on it for large reports. SVG output grows roughly with the number of drawn elements, so very large series produce big payloads and can pressure memory and CPU during generation. For big datasets, consider aggregating or downsampling before charting, and generate heavy reports in a queue.
Is svg-charts a good alternative to Chart.js or ApexCharts for interactive dashboards?
Not for interactive dashboards. SVG Charts produces static server-rendered SVGs with no tooltips, zoom, or client-side interactivity, whereas Chart.js and ApexCharts are built for that. It is the right choice when you specifically want to avoid shipping a JS charting runtime in PDFs, emails, and scheduled reports. Use the JS libraries where interactivity is a product requirement.
Is dpodsiadlo/svg-charts actively maintained and does it follow semver?
The v1.0.5 patch fixing implicit conversion is a positive signal that the package is being kept working on modern PHP, but it is a small package with a single primary maintainer, so bus factor is a real consideration. Test coverage and CI posture are not evidenced in the release notes. Pin the version in composer.json, review the changelog before upgrades, and wrap the library in your own service class so replacement is a one-file change.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle