Download the PHP package laravel-enso/charts without Composer
On this page you can find all versions of the php package laravel-enso/charts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-enso/charts
More information about laravel-enso/charts
Files in laravel-enso/charts
Package charts
Short Description Backend chart payload builders for Laravel Enso
License MIT
Homepage https://github.com/laravel-enso/charts
Informations about the package charts
Charts
Description
Charts is Laravel Enso's backend chart payload builder for the @enso-ui/charts frontend package.
It provides fluent factories for the chart types used across Enso dashboards and reporting screens, then returns normalized arrays that can be serialized directly to the frontend. The package also centralizes default chart colors, plugin defaults, datalabel handling, and axis configuration so host applications can generate consistent Chart.js payloads without hand-crafting dataset structures.
Installation
This package comes pre-installed in Laravel Enso applications that render chart widgets or dashboard analytics.
For standalone installation inside an Enso-based application:
The package auto-registers its service provider and merges the enso.charts configuration namespace.
If you need to publish the configuration file:
or:
Features
- Provides dedicated factories for:
- bar charts
- line charts
- bubble charts
- radar charts
- pie charts
- doughnut charts
- polar area charts
- Returns Chart.js-ready payloads through a single
get()call. - Supports fluent chart metadata such as:
- title
- aspect ratio
- plugin configuration
- per-option overrides
- Supports per-axis configuration for Cartesian charts.
- Supports per-dataset configuration overrides by dataset label.
- Supports custom palettes through
colorsConfig(). - Supports chart datalabel configuration through
datalabels(). - Supports optional gridlines and automatic Y-axis minimum handling.
- Supports short-number formatting hints for the frontend.
- Ships default Enso chart colors and plugin defaults in
config/enso/charts.php.
Usage
Bar chart
Line chart
Bubble chart
::: tip Tip
Bubble charts auto-scale point radius by default. If the dataset already contains the exact radius values you want to render, call disableAutoRadius() before get().
:::
API
Factories
LaravelEnso\Charts\Factories\BarAddshorizontal()andstackedScales()helpers for bar datasets.LaravelEnso\Charts\Factories\LineAddsfill()for filled line charts.LaravelEnso\Charts\Factories\BubbleMaps[x, y, radius]tuples into bubble datasets and can auto-scale radius values.LaravelEnso\Charts\Factories\RadarBuilds radar chart datasets.LaravelEnso\Charts\Factories\PieBuilds pie chart payloads.LaravelEnso\Charts\Factories\DoughnutBuilds doughnut chart payloads.LaravelEnso\Charts\Factories\PolarBuilds polar area chart payloads.
Shared fluent methods
All chart factories inherit these methods from LaravelEnso\Charts\Factories\Chart:
title(string $title)labels(array $labels)datasets(array $datasets)ratio(float $ratio)option(string $option, mixed $value)plugin(string $plugin, mixed $config)shortNumbers(int $precision = 2)gridlines()autoYMin()datalabels(array $config)colorsConfig(array $colors)datasetConfig(string $dataset, array $config)xAxisConfig(array $config, ?string $dataset = 'x')yAxisConfig(array $config, ?string $dataset = 'y')get()
Payload shape
The factories return arrays with this top-level structure:
typetitledataoptions
For Cartesian charts, data contains:
labelsdatasets
For bubble charts, data contains:
datasets
Each dataset is normalized for the target chart type and enriched with default Enso colors plus datalabel configuration.
Configuration
Config file:
config/enso/charts.php
Current package options:
fillBackgroundOpacityOpacity used when converting a hex color into an RGBA fill color.optionsDefault Chart.js options merged into each factory response.colorsDefault Enso chart palette used when no custom colors are supplied.
Depends On
Required Enso packages:
Companion frontend package:
Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!