Download the PHP package vitopedro/laravel-chartjs without Composer
On this page you can find all versions of the php package vitopedro/laravel-chartjs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vitopedro/laravel-chartjs
More information about vitopedro/laravel-chartjs
Files in vitopedro/laravel-chartjs
Informations about the package laravel-chartjs
Description
This is a wrapper of chart.js in php to be used in Laravel Framework.
This component offers an easy and fast interface to add charts to a lavaravel application.
Setup
Installation
Install it via composer with the command:
Configuration
1 - Add the service provider to your application in your configuration file that is normally under config/app.php
2 - Test your application with php artisan serve
, if it has errors, reset your composer qutoload with:
3 - Publish the public assets with the the command:
if everything worked correctlly, you will have in your application's public folder a folder vitopedro\chartjs
Usage
Include the class coresponding to the chart type nedeed, the minimum requirement for a chart to properlly render is to set the labels and the series. It is also recommended to set the title, but not mandatory.
Line/Area/Column
Those chart types are similar and can be used interchangeblly to represent the same set of data. In those types, the labels correspond to the points in the x axix of the chart and are required to properlly render the data. The series corresponds to the data itself, and it is an array containing in each position a label and a data positions. The label is to be used in the legend and in the tooltip of the chart, the data should be an array of numbers and should have the same length that labels has.
Examples
Line chart
Area chart
Column chart
Pie
This chart type differs from the the previous ones, since it doesnt have x axix. In here the labels correspond to the legend or tooltip of each value. To create a pure pie chart only one serie should be used, if multiple series are passed to the setSeries function, multiple circles will be rendered. In the series, the label must also be sent in order to maintain consistency, but it is not rendered anywhere.