Download the PHP package jccoca/filament-chart-palette without Composer
On this page you can find all versions of the php package jccoca/filament-chart-palette. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jccoca/filament-chart-palette
More information about jccoca/filament-chart-palette
Files in jccoca/filament-chart-palette
Package filament-chart-palette
Short Description A FilamentPHP package to easily apply vibrant color palettes and RGBA colors to Filament chart widgets running on Tailwind CSS v4.
License MIT
Homepage https://github.com/jccoca/filament-chart-palette
Informations about the package filament-chart-palette
Filament Chart Palette
🇧🇷 Para a versão em Português, clique aqui
Easily apply dynamic color palettes and custom RGBA colors to your FilamentPHP chart widgets. Compatible with Filament v4 / v5 and Tailwind CSS v4.
About
Filament Chart Palette provides a clean and convenient way to apply color palettes to FilamentPHP charts.
With Tailwind CSS v4 native OKLCH color definitions, charting libraries (such as Chart.js inside Filament) require explicit rgba(...) strings to properly handle opacity and canvas background rendering. This library seamlessly converts Filament's Color::class definitions into ordered RGBA color arrays optimized for each specific chart type.
Requirements
- PHP
^8.2 - Filament
^4.0or^5.0 - Tailwind CSS
v4.x
Installation
Install the package via Composer:
Usage
Apply a Color Palette to a Specific Chart Type
Simply import and use the HasChartPalette trait in your Filament Chart Widgets:
Automatic Palette Based on Chart Type
You can dynamically pass $this->getType() to automatically match the palette order to the specific widget chart type (e.g., pie, doughnut, bar, line, etc.):
Apply Specific Color to a Dataset
If you need a single color for a dataset in a bar, line, area, or other chart type: