chartron / app
Advanced charts for laravel
Installs: 56
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/chartron/app
Requires (Dev)
- orchestra/testbench: ^3.8
This package is auto-updated.
Last update: 2025-12-25 00:50:15 UTC
README
About Chartron
Chartron is a PHP library with elegant syntax. The easiest way to setup your dataset.
If you are using the Laravel framework i highly recommend the usage of chartron-routes
Example usage
This example code generates the dataset for the graph above.
//declare the library use Chartron\APP\Chartron; //build and configurations $chartron = Chartron::build(); $chartron->monthLabels("EN"); //chart customization options $options1 = ["backgroundColor"=>"#F20000"]; $options2 = ["backgroundColor"=>"#10A774"]; //set chartron datasets $chartron->dataset("Team",[4,2,1,4,3,1,2,5,7,3,1,3],$options1); $chartron->dataset('User',[1,2,7,6,4,5,1,5,7,1,2,5],$options2); //return the json data object return $chartron->keep();
Instalation
composer require chartron/app
First Steps
First initiate the cartron object
$chartron = Chartron::build();
Setup the chart label
$chartron->labels(["First","Second","Third"]);
Setup the dataset
$chartron->dataset("Users",[4,2,1]);
Then use the method keep to generate the JSON object;
$chartron->keep();
Options
Inside the option field you have the possibily to customtize with whenever you want based in the front end library chart you are using.
$options = ["backgroundColor"=>"#F20000"];
In this example i'm using Chart JS so i set the backgroundColor to #F20000 according to the Chart JS documentation
