├── .editorconfig ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml ├── SECURITY.md ├── dependabot.yml └── workflows │ ├── dependabot-auto-merge.yml │ ├── fix-php-code-style-issues.yml │ ├── phpstan.yml │ └── update-changelog.yml ├── .gitignore ├── .prettierrc ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── docs ├── _index.md ├── filament.md ├── getting-started │ ├── _index.md │ ├── changelog.md │ └── installation.md └── introduction.md ├── phpstan-baseline.neon ├── phpstan.neon.dist ├── pint.json ├── resources └── views │ ├── tables │ └── columns │ │ └── inline-chart.blade.php │ └── widgets │ └── inline-chart.blade.php └── src ├── InlineChartServiceProvider.php ├── InlineChartWidget.php └── Tables └── Columns └── InlineChart.php /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | Please read and understand the contribution guide before creating an issue or pull request. 6 | 7 | ## Etiquette 8 | 9 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code 10 | held within. They make the code freely available in the hope that it will be of use to other developers. It would be 11 | extremely unfair for them to suffer abuse or anger for their hard work. 12 | 13 | Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the 14 | world that developers are civilized and selfless people. 15 | 16 | It's the duty of the maintainer to ensure that all submissions to the project are of sufficient 17 | quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. 18 | 19 | ## Viability 20 | 21 | When requesting or submitting new features, first consider whether it might be useful to others. Open 22 | source projects are used by many developers, who may have entirely different needs to your own. Think about 23 | whether or not your feature is likely to be used by other users of the project. 24 | 25 | ## Procedure 26 | 27 | Before filing an issue: 28 | 29 | - Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. 30 | - Check to make sure your feature suggestion isn't already present within the project. 31 | - Check the pull requests tab to ensure that the bug doesn't have a fix in progress. 32 | - Check the pull requests tab to ensure that the feature isn't already in progress. 33 | 34 | Before submitting a pull request: 35 | 36 | - Check the codebase to ensure that your feature doesn't already exist. 37 | - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. 38 | 39 | ## Requirements 40 | 41 | If the project maintainer has any additional requirements, you will find them listed here. 42 | 43 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). 44 | 45 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 46 | 47 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 48 | 49 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. 50 | 51 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 52 | 53 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 54 | 55 | **Happy coding**! 56 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: atmonshi 2 | custom: "https://www.buymeacoffee.com/larazeus" 3 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | If you discover any security related issues, please email info@larazeus.com instead of using the issue tracker. 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Please see the documentation for all configuration options: 2 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 3 | 4 | version: 2 5 | updates: 6 | 7 | - package-ecosystem: "github-actions" 8 | directory: "/" 9 | schedule: 10 | interval: "weekly" 11 | labels: 12 | - "dependencies" -------------------------------------------------------------------------------- /.github/workflows/dependabot-auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: dependabot-auto-merge 2 | on: pull_request_target 3 | 4 | permissions: 5 | pull-requests: write 6 | contents: write 7 | 8 | jobs: 9 | dependabot: 10 | runs-on: ubuntu-latest 11 | if: ${{ github.actor == 'dependabot[bot]' }} 12 | steps: 13 | 14 | - name: Dependabot metadata 15 | id: metadata 16 | uses: dependabot/fetch-metadata@v2.4.0 17 | with: 18 | github-token: "${{ secrets.GITHUB_TOKEN }}" 19 | 20 | - name: Auto-merge Dependabot PRs for semver-minor updates 21 | if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} 22 | run: gh pr merge --auto --merge "$PR_URL" 23 | env: 24 | PR_URL: ${{github.event.pull_request.html_url}} 25 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 26 | 27 | - name: Auto-merge Dependabot PRs for semver-patch updates 28 | if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} 29 | run: gh pr merge --auto --merge "$PR_URL" 30 | env: 31 | PR_URL: ${{github.event.pull_request.html_url}} 32 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} -------------------------------------------------------------------------------- /.github/workflows/fix-php-code-style-issues.yml: -------------------------------------------------------------------------------- 1 | name: code style 2 | 3 | on: [push] 4 | 5 | jobs: 6 | php-code-styling: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - name: Checkout code 11 | uses: actions/checkout@v4 12 | with: 13 | ref: ${{ github.head_ref }} 14 | 15 | - name: Fix PHP code style issues 16 | uses: aglipanci/laravel-pint-action@2.5 17 | 18 | - name: Commit changes 19 | uses: stefanzweifel/git-auto-commit-action@v5 20 | with: 21 | commit_message: Fix styling 22 | -------------------------------------------------------------------------------- /.github/workflows/phpstan.yml: -------------------------------------------------------------------------------- 1 | name: PHPStan 2 | 3 | on: 4 | push: 5 | paths: 6 | - '**.php' 7 | - 'phpstan.neon.dist' 8 | 9 | jobs: 10 | phpstan: 11 | name: phpstan 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Setup PHP 17 | uses: shivammathur/setup-php@v2 18 | with: 19 | php-version: '8.1' 20 | coverage: none 21 | 22 | - name: Install composer dependencies 23 | uses: ramsey/composer-install@v3 24 | 25 | - name: Run PHPStan 26 | run: ./vendor/bin/phpstan --error-format=github -------------------------------------------------------------------------------- /.github/workflows/update-changelog.yml: -------------------------------------------------------------------------------- 1 | name: "Update Changelog" 2 | 3 | on: 4 | release: 5 | types: [released] 6 | 7 | jobs: 8 | update: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v4 14 | with: 15 | ref: 1.x 16 | 17 | - name: Update Changelog 18 | uses: stefanzweifel/changelog-updater-action@v1 19 | with: 20 | latest-version: ${{ github.event.release.name }} 21 | release-notes: ${{ github.event.release.body }} 22 | 23 | - name: Commit updated CHANGELOG 24 | uses: stefanzweifel/git-auto-commit-action@v5 25 | with: 26 | branch: 1.x 27 | commit_message: Update CHANGELOG 28 | file_pattern: CHANGELOG.md 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | /vendor/.idea 7 | /bootstrap/cache 8 | .env 9 | .env.backup 10 | .phpunit.result.cache 11 | docker-compose.override.yml 12 | Homestead.json 13 | Homestead.yaml 14 | npm-debug.log 15 | yarn-error.log 16 | /.idea 17 | /.vscode 18 | /pkg 19 | /build 20 | .DS_Store 21 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true, 4 | "trailingComma": "all" 5 | } 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | info@larazeus.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Lara Zeus (Ash) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

easily add a chart in filamentPHP table column.

6 | 7 |

8 | 9 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/lara-zeus/inline-chart.svg?style=flat-square)](https://packagist.org/packages/lara-zeus/inline-chart) 10 | [![Code Style](https://img.shields.io/github/actions/workflow/status/lara-zeus/inline-chart/fix-php-code-style-issues.yml?label=code-style&flat-square)](https://github.com/lara-zeus/inline-chart/actions?query=workflow%3Afix-php-code-style-issues+branch%3Amain) 11 | [![Total Downloads](https://img.shields.io/packagist/dt/lara-zeus/inline-chart.svg?style=flat-square)](https://packagist.org/packages/lara-zeus/inline-chart) 12 | [![Total Downloads](https://img.shields.io/github/stars/lara-zeus/inline-chart?style=flat-square)](https://github.com/lara-zeus/inline-chart) 13 | 14 |

15 | 16 | ## features 17 | - 🔥 Use any filament chart classes 18 | - 🔥 Better tooltip 19 | - 🔥 Use any widget type 20 | - 🔥 Max Width 21 | - 🔥 Polling 22 | 23 | ## Screenshots 24 | 25 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-1.webp) 26 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-2.webp) 27 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-3.webp) 28 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-4.webp) 29 | 30 | ## Demo 31 | 32 | > Visit our demo site: https://demo.larazeus.com/admin/components-demo/inline-chart 33 | 34 | ## Full Documentation 35 | 36 | > Visit our website to get the complete documentation: https://larazeus.com/docs/inline-chart 37 | 38 | ## Changelog 39 | 40 | Please see [CHANGELOG](CHANGELOG.md) for more information on recent changes. 41 | 42 | ## Support 43 | available support channels: 44 | 45 | * Join our channel on [Discord](https://discord.com/channels/883083792112300104/1282761082158452787) 46 | * open an issue on [GitHub](https://github.com/lara-zeus/inline-chart/issues) 47 | * Email us using the [contact center](https://larazeus.com/contact-us) 48 | 49 | ## Contributing 50 | 51 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. 52 | 53 | ## Security 54 | 55 | If you find any security-related issues, please email info@larazeus.com instead of using the issue tracker. 56 | 57 | ## Credits 58 | 59 | - [Lara Zeus (Ash)](https://github.com/atmonshi) 60 | - [All Contributors](../../contributors) 61 | 62 | ## License 63 | 64 | The MIT License (MIT). Please have a look at [License File](LICENSE.md) for more information. 65 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lara-zeus/inline-chart", 3 | "description": "Zeus Inline Chart easily add a chart in filamentPHP table column", 4 | "keywords": [ 5 | "laravel", 6 | "lara-zeus", 7 | "ui", 8 | "chart", 9 | "table", 10 | "mini", 11 | "inline", 12 | "design", 13 | "input", 14 | "coulmn", 15 | "generator", 16 | "filamentphp" 17 | ], 18 | "homepage": "https://larazeus.com/inline-chart", 19 | "support": { 20 | "issues": "https://github.com/lara-zeus/inline-chart/issues", 21 | "source": "https://github.com/lara-zeus/inline-chart" 22 | }, 23 | "license": "MIT", 24 | "type": "library", 25 | "authors": [ 26 | { 27 | "name": "Lara Zeus (Ash)", 28 | "email": "info@larazeus.com" 29 | } 30 | ], 31 | "require": { 32 | "php": "^8.1", 33 | "filament/filament": "^3.0", 34 | "spatie/laravel-package-tools": "^1.16" 35 | }, 36 | "require-dev": { 37 | "laravel/pint": "^1.0", 38 | "nunomaduro/collision": "^7.0", 39 | "nunomaduro/larastan": "^2.0.1", 40 | "nunomaduro/phpinsights": "^2.8", 41 | "orchestra/testbench": "^8.0", 42 | "phpstan/extension-installer": "^1.1" 43 | }, 44 | "autoload": { 45 | "psr-4": { 46 | "LaraZeus\\InlineChart\\": "src" 47 | } 48 | }, 49 | "scripts": { 50 | "analyse": "vendor/bin/phpstan analyse", 51 | "format": "vendor/bin/pint", 52 | "pint": "vendor/bin/pint", 53 | "test:phpstan": "vendor/bin/phpstan analyse" 54 | }, 55 | "config": { 56 | "sort-packages": true, 57 | "allow-plugins": { 58 | "phpstan/extension-installer": true, 59 | "dealerdirect/phpcodesniffer-composer-installer": true 60 | } 61 | }, 62 | "extra": { 63 | "laravel": { 64 | "providers": [ 65 | "LaraZeus\\InlineChart\\InlineChartServiceProvider" 66 | ] 67 | } 68 | }, 69 | "minimum-stability": "dev", 70 | "prefer-stable": true 71 | } 72 | -------------------------------------------------------------------------------- /docs/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: v1 3 | slogan: filamentphp column to easily add a chart in filamentPHP table column 4 | githubUrl: https://github.com/lara-zeus/inline-chart 5 | branch: v1.x 6 | icon: heroicon-o-chart-bar-square 7 | --- 8 | -------------------------------------------------------------------------------- /docs/filament.md: -------------------------------------------------------------------------------- 1 | # Zeus Inline Chart 2 | 3 | Inline Chart is to easily add a chart in filamentPHP table column 4 | 5 | ## Features 6 | 7 | - 🔥 Use any filament chart classes 8 | - 🔥 Better tooltip 9 | - 🔥 Use any widget type 10 | - 🔥 Max Width 11 | - 🔥 Polling 12 | 13 | ## Screenshots 14 | 15 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-1.webp) 16 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-2.webp) 17 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-3.webp) 18 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-4.webp) 19 | 20 | ## More Details 21 | **✨ to learn more about Zeus Inline Chart, please visit:** 22 | 23 | - [Discord](https://discord.com/channels/883083792112300104/1282761082158452787) 24 | - [Docs](https://larazeus.com/docs/inline-chart) 25 | - [Github](https://github.com/lara-zeus/inline-chart) 26 | - [Demo](https://demo.larazeus.com/admin/components-demo/inline-chart) 27 | -------------------------------------------------------------------------------- /docs/getting-started/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Getting Started 3 | weight: 1 4 | --- 5 | -------------------------------------------------------------------------------- /docs/getting-started/changelog.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Changelog 3 | weight: 100 4 | --- 5 | 6 | All changes to @zeus `Inline Chart` are auto updated documented on GitHub [changelog](https://github.com/lara-zeus/inline-chart/blob/1.x/CHANGELOG.md) 7 | -------------------------------------------------------------------------------- /docs/getting-started/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Installation 3 | weight: 3 4 | --- 5 | 6 | ## Installation 7 | 8 | Install @zeus Inline Chart by running the following commands in your Laravel project directory. 9 | 10 | ```bash 11 | composer require lara-zeus/inline-chart 12 | ``` 13 | 14 | ## Usage: 15 | 16 | ### Create a New widget: 17 | 18 | - first create a new widget using filament command: 19 | 20 | `art make:filament-widget MyTableWidgetChart` 21 | 22 | - change the extend of the class to use the abstract: 23 | 24 | `\LaraZeus\InlineChart\InlineChartWidget` 25 | 26 | - available properties: 27 | 28 | ```php 29 | protected static ?string $maxHeight = '50px'; 30 | 31 | protected int | string | array $columnSpan = 'full'; 32 | 33 | protected static ?string $heading = 'Chart'; 34 | 35 | public ?string $maxWidth = '!w-[150px]'; 36 | ``` 37 | 38 | and you can access the current row record using: `$this->record` in your chart data: 39 | 40 | ```php 41 | Model::where('child_id',$this->record->id) 42 | ``` 43 | 44 | ### use it in your table: 45 | 46 | ```php 47 | \LaraZeus\InlineChart\Tables\Columns\InlineChart::make('last activities') 48 | ->chart(MiniChart::class) 49 | ->maxWidth(350)// int, default 200 50 | ->maxHeight(90)// int, default 50 51 | ->description('description') 52 | ->toggleable(), 53 | ``` 54 | -------------------------------------------------------------------------------- /docs/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | weight: 1 4 | --- 5 | 6 | ## Introduction 7 | @zeus Inline Chart to easily add a chart in filamentPHP table column 8 | 9 | **[Demo](https://demo.larazeus.com/admin/components-demo/inline-chart) · [Github](https://github.com/lara-zeus/inline-chart) · [Discord](https://discord.com/channels/883083792112300104/1282761082158452787)** 10 | 11 | ## Features 12 | 13 | - 🔥 Use any filament chart classes 14 | - 🔥 Better tooltip 15 | - 🔥 Use any widget type 16 | - 🔥 Max Width 17 | - 🔥 Polling 18 | 19 | ## Screenshots 20 | 21 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-1.webp) 22 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-2.webp) 23 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-3.webp) 24 | ![](https://larazeus.com/images/screenshots/inline-chart/inline-chart-4.webp) 25 | 26 | ## Support 27 | 28 | Available support channels: 29 | 30 | * Join our channel on [Discord](https://discord.com/channels/883083792112300104/1282761082158452787) 31 | * Open an issue on [GitHub](https://github.com/lara-zeus/inline-chart/issues) 32 | * Email us using the [contact center](https://larazeus.com/contact-us) 33 | -------------------------------------------------------------------------------- /phpstan-baseline.neon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lara-zeus/inline-chart/fe4e90acedea2e3cf16dbce09ba8066860803d5e/phpstan-baseline.neon -------------------------------------------------------------------------------- /phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | includes: 2 | - phpstan-baseline.neon 3 | 4 | parameters: 5 | level: 6 6 | paths: 7 | - src 8 | 9 | checkOctaneCompatibility: true 10 | checkModelProperties: true 11 | checkMissingIterableValueType: false 12 | checkGenericClassInNonGenericObjectType: false 13 | -------------------------------------------------------------------------------- /pint.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "laravel", 3 | "rules": { 4 | "blank_line_before_statement": true, 5 | "concat_space": { 6 | "spacing": "one" 7 | }, 8 | "method_argument_space": true, 9 | "single_trait_insert_per_statement": true, 10 | "types_spaces": { 11 | "space": "single" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /resources/views/tables/columns/inline-chart.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @php 3 | $getState = $getState(); 4 | $getMaxWidth = $getMaxWidth(); 5 | $getMaxHeight = $getMaxHeight(); 6 | $getIcon = $getIcon($getState); 7 | $descriptionAbove = $getDescriptionAbove(); 8 | $descriptionBelow = $getDescriptionBelow(); 9 | $canWrap = $canWrap(); 10 | $getChart = $getChart(); 11 | $getRecord = $getRecord(); 12 | @endphp 13 | 14 | @if (filled($descriptionAbove)) 15 |

$canWrap, 19 | ]) 20 | > 21 | {{ $descriptionAbove }} 22 |

23 | @endif 24 | 25 |
32 | @livewire($getChart, ['maxWidth' => $getMaxWidth, 'maxHeight' => $getMaxHeight, 'lazy' => true, 'record' => $getRecord], key("chart-{$getRecord->id}")) 33 |
34 | 35 | @if (filled($descriptionBelow)) 36 |

$canWrap, 40 | ]) 41 | > 42 | {{ $descriptionBelow }} 43 |

44 | @endif 45 | 46 | @pushonce('scripts') 47 | 82 | @endpushonce 83 |
84 | -------------------------------------------------------------------------------- /resources/views/widgets/inline-chart.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | use Filament\Support\Enums\MaxWidth; 3 | use Filament\Support\Facades\FilamentView; 4 | 5 | $color = $this->getColor(); 6 | $heading = $this->getHeading(); 7 | $filters = $this->getFilters(); 8 | @endphp 9 | 10 |
13 |
getPollingInterval()) 15 | wire:poll.{{ $pollingInterval }}="updateChartData" 16 | @endif 17 | > 18 |
33 | 40 | 41 | 'text-gray-100 dark:text-gray-800', 46 | default => 'text-custom-50 dark:text-custom-400/10', 47 | }, 48 | ]) 49 | @style([ 50 | \Filament\Support\get_color_css_variables( 51 | $color, 52 | shades: [50, 400], 53 | alias: 'widgets::chart-widget.background', 54 | ) => $color !== 'gray', 55 | ]) 56 | > 57 | 58 | 'text-gray-400', 63 | default => 'text-custom-500 dark:text-custom-400', 64 | }, 65 | ]) 66 | @style([ 67 | \Filament\Support\get_color_css_variables( 68 | $color, 69 | shades: [400, 500], 70 | alias: 'widgets::chart-widget.border', 71 | ) => $color !== 'gray', 72 | ]) 73 | > 74 | 75 | 79 | 80 | 84 | 85 |


86 |
87 |
88 |
89 |
90 | -------------------------------------------------------------------------------- /src/InlineChartServiceProvider.php: -------------------------------------------------------------------------------- 1 | name(static::$name) 16 | ->hasViews(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/InlineChartWidget.php: -------------------------------------------------------------------------------- 1 | chart = $chart; 27 | 28 | return $this; 29 | } 30 | 31 | public function getChart(): string 32 | { 33 | if ($this->chart === null) { 34 | throw new \Exception('set the chart class first'); 35 | } 36 | 37 | return $this->chart; 38 | } 39 | 40 | public function maxWidth(int $maxWidth): static 41 | { 42 | $this->maxWidth = $maxWidth; 43 | 44 | return $this; 45 | } 46 | 47 | public function getMaxWidth(): int 48 | { 49 | return $this->maxWidth; 50 | } 51 | 52 | public function maxHeight(int $maxHeight): static 53 | { 54 | $this->maxHeight = $maxHeight; 55 | 56 | return $this; 57 | } 58 | 59 | public function getMaxHeight(): int 60 | { 61 | return $this->maxHeight; 62 | } 63 | } 64 | --------------------------------------------------------------------------------