Download the PHP package bbsnly/chartjs-php without Composer
On this page you can find all versions of the php package bbsnly/chartjs-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bbsnly/chartjs-php
More information about bbsnly/chartjs-php
Files in bbsnly/chartjs-php
Package chartjs-php
Short Description PHP wrapper for Chart.js library
License MIT
Homepage https://github.com/bbsnly/chartjs-php
Informations about the package chartjs-php
ChartJS-PHP
This package transforms how you create ChartJS elements by bringing them directly into PHP.
ChartJS-PHP eliminates the complexity of JavaScript when working with ChartJS charts. While ChartJS traditionally requires JavaScript implementation, our PHP solution delivers the same powerful charts through clean, efficient PHP code. By generating ChartJS elements directly in PHP, you write less code, maintain cleaner codebases, and deliver faster results. This is the definitive solution for PHP developers building data visualizations, dashboards, or any application requiring dynamic charts.
Note: Include the ChartJS library in your project as specified in their official documentation.
Installation
Installing ChartJS-PHP is straightforward with Composer. Run this command in your project directory:
Minimum Requirements:
- PHP version: 8.1 or higher
- ChartJS version: 2.0 or higher
Usage
Creating charts with ChartJS-PHP is simple and intuitive. Start by instantiating the Chart
class, define your data, and render your chart. The library handles all the complexity for you.
Choose from our specialized chart classes for even faster development: BarChart
, BubbleChart
, DoughnutChart
, LineChart
, PieChart
, PolarAreaChart
, RadarChart
, and ScatterChart
.
Here's how to create a line chart:
In the example below we will use the toHtml
method to generate the HTML and JavaScript code for the chart.
In the example below we will use the toJson
method to generate the JSON representation of the chart data.
Tests
Run the test suite with:
Contributing
Read our Contributing guidelines and start improving ChartJS-PHP today.
License
The ChartJS PHP is open-sourced software licensed under the MIT license.