Download the PHP package ridwan/laravel-pdf-charts without Composer
On this page you can find all versions of the php package ridwan/laravel-pdf-charts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-pdf-charts
Laravel PDF Charts
Generate beautiful, server-side chart images and PDFs in Laravel using Chart.js-style configurations โ without requiring a browser or external chart service in your Laravel application.
โจ Features
- ๐ Generate charts directly from Laravel
- ๐งฉ Chart.js-style configuration
- ๐ผ๏ธ Export charts as PNG, SVG, WebP, or PDF
- โก Server-side rendering
- ๐จ Custom chart dimensions and background colors
- ๐ Configurable device pixel ratio
- ๐ Support for Chart.js versions
- ๐พ Save generated charts directly to disk
- ๐ข Generate Base64 or Data URI representations
- ๐งฑ Fluent API
- ๐ Laravel dependency injection support
- ๐ฆ Simple Composer installation
- ๐ชถ No browser required in your Laravel application
๐ฆ Installation
Install the package using Composer:
Publish Configuration
Publishing the configuration file is optional:
After publishing, you can customize the package configuration according to your application's requirements.
๐ Quick Start
Import the Chart facade:
Then create a chart using a Chart.js-style configuration:
The generated chart is returned as binary output, which you can use in your Laravel application.
๐ Supported Charts
The package supports the following chart types:
| Type | Description |
|---|---|
bar |
Vertical or horizontal bars for comparing values |
line |
Connected points for displaying trends |
pie |
Circular segments representing parts of a whole |
doughnut |
Pie chart with a cut-out center |
radar |
Multi-axis spider/web chart for comparing variables |
polarArea |
Circular segments where angle and radius represent values |
scatter |
Individual (x, y) points for correlation or distribution |
bubble |
Scatter-style chart with radius representing a third dimension |
You can also create mixed charts by specifying different chart types for individual datasets.
๐ Chart Examples
Bar Chart
Line Chart
Pie Chart
Doughnut Chart
Radar Chart
Polar Area Chart
Scatter Chart
Scatter charts use objects containing x and y values:
Bubble Chart
Bubble charts support an additional r value representing the bubble radius:
๐ ๏ธ Fluent API
Customize the generated chart using the fluent API:
Available Options
| Method | Description |
|---|---|
width(800) |
Set chart width |
height(400) |
Set chart height |
format('png') |
Set output format |
backgroundColor('white') |
Set chart background |
devicePixelRatio(2) |
Configure rendering pixel density |
version('4') |
Specify Chart.js version |
render() |
Generate the chart |
Supported Formats
For example:
๐ข Base64 & Data URI
Generate a Base64 representation of the chart:
By default, the result can be returned as a Data URI.
If you only need the raw Base64 content:
This can be useful when embedding charts into HTML, emails, APIs, or other documents.
๐พ Save Charts to Disk
Save the generated chart directly to a file:
You can also select the desired format before saving:
๐๏ธ How It Works
The package follows a simple rendering flow:
The goal is to keep chart generation inside your Laravel application while exposing a simple PHP API.
๐ License
This package is open-sourced software licensed under the MIT License.
See the LICENSE file for more information.
โญ Support
If this package helps you build better Laravel applications, consider giving the repository a โญ on GitHub.
Your feedback, issues, and contributions are also welcome.
๐ฆ Package
Package: ridwan/laravel-pdf-charts
Purpose: Server-side chart generation for Laravel
Output formats: PNG ยท SVG ยท WebP ยท PDF
Chart configuration: Chart.js-style
License: MIT
All versions of laravel-pdf-charts with dependencies
illuminate/http Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0