filament icon indicating copy to clipboard operation
filament copied to clipboard

Add empty state to chart widget

Open juliangums opened this issue 1 year ago • 3 comments

Description

[!CAUTION] DON'T MERGE THIS YET!

@danharrin as discussed in https://github.com/filamentphp/filament/discussions/13311 I have added a feature to display an empty state on chart widgets. Before this is merged, I'd like to ask a couple of things as I am not entirely familiar with everything in Filament:

  1. I added a string and translations for en and de. Is that enough? How are all the other translations handled for so many languages?
  2. I didn’t use screenshots or links in the docs as I didn’t know how to do them.
  3. The implementation is very much based on the work done on tables. But as we aren't defining these things by calling methods on an object but rather by defining a class that extends ChartWidget, I removed all the setters from it. But I guess that also means closures don't really make sense for the attributes or do they? I want to make sure this is in the spirit of Filament so any guidance would be much appreciated.
  4. Is everything else as you'd expect? Anything I missed?

Let me know and I'll get the rest sorted. Otherwise, it's ready to be tested.

Visual changes

Screenshot 2024-06-26 at 23 22 49

Functional changes

  • [x] Code style has been fixed by running the composer cs command.
  • [x] Changes have been tested to not break existing functionality.
  • [x] Documentation is up-to-date.

juliangums avatar Jun 26 '24 21:06 juliangums

@zepfietje that would make a ton of sense. Let me know when that’s done or if you need any help just instruct me.

juliangums avatar Jun 27 '24 07:06 juliangums

Great! It's at the top of my list, so will get to it as soon as possible.

I'll mark this PR as draft until we can move forward. 👍

zepfietje avatar Jun 27 '24 07:06 zepfietje

Started working on https://github.com/filamentphp/filament/pull/13642.

zepfietje avatar Jul 19 '24 08:07 zepfietje

Going to close this since there was no movement on #13642. Next step would be putting in a v4 PR for an empty state Blade component, and then opening another PR to add that to the chart widget.

danharrin avatar Jan 30 '25 11:01 danharrin