This repository is dedicated to demonstrating the capabilities of the Laravel Chartjs package, which is a powerful interface for integrating Chart.js version 4 into Laravel applications. With a focus on the latest Chart.js features, this demo provides a comprehensive look at the extensive chart options available, including new chart types, animations, and interactivity enhancements.
Included in this repository is a UserController
example that illustrates how to implement user-related data visualizations using Chart.js version 4. It serves as a practical guide for developers looking to add interactive and customizable charts to their Laravel projects, with detailed examples on utilizing the advanced design and chart options provided by Chart.js.
The demo repository features Tufte chart examples, which are designed to display complex data in a clear and beautiful way, following the principles of Edward Tufte. These examples help in creating elegant and informative charts that enhance the data presentation, while also demonstrating how to apply the data-ink ratio concept using Chart.js design options to make your charts as informative as possible with minimal distractions.
This repository also includes examples of Stephen Few chart makeovers, which are designed to present complex data in a clear and engaging manner, adhering to the principles of Stephen Few, an expert in dashboard and chart design. These examples embody Few's philosophy of simplicity and clarity in data visualization, emphasizing the elimination of unnecessary elements to focus on the data itself. They serve as a practical guide for creating elegant and informative charts that enhance data presentation. They demonstrate how to apply Stephen Few's design principles using Chart.js to make your graphs as informative as possible with minimal distractions, in line with his "less is more" approach to data visualization.
To get started with the Laravel Chartjs package demo, clone the repository and follow the setup instructions provided in the Laravel Chart.js User Guide. Explore the various chart examples to learn how to integrate and customize charts in your own Laravel applications.
You can run the app using php artisan serve or any local development environment such as Valet or Herd. In which, case the demo pages will be available at:
- /legacy
- /user/chart
- /tufte/charts
- /stephenfew/charts
To run the examples locally via Docker (if you're on MacOS, use Orbstack to solve file system performance woes!), first build the services:
docker-compose build
Copy the .env.example
file:
cp .env.example .env
Then start the services:
./bin/up
Run the init command to install dependencies etc:
./bin/init
When you're done, shut down the services with:
./bin/down
Contributions are welcome! If you have any improvements or additional examples, please feel free to submit a pull request.
This demo is open-sourced software licensed under the MIT license.