Closed maltebaer closed 6 months ago
If I try to render a Chart Widget in a loop, all of the charts get appended to the first component.
I guess it is due to protected static string $chartId = 'apexChart' being assigned a default value. Hence
protected static string $chartId = 'apexChart'
/** * Retrieves the chart id. * * @return string|null The chart id. */ protected function getChartId(): ?string { return static::$chartId ?? 'apexChart_'.Str::random(10); }
will never append a random string.
Changing the property to protected static ?string $chartId will do the trick but I'm not sure if this leads to unwanted side effects.
protected static ?string $chartId
If you think making the property nullable will do the trick, I'm happy to submit a PR.
@maltebaer thank you! Check the new version 3.1.1 https://github.com/leandrocfe/filament-apex-charts/releases/tag/3.1.1
Awesome, it works like charm! Thanks a lot for the quick fix!
If I try to render a Chart Widget in a loop, all of the charts get appended to the first component.
I guess it is due to
protected static string $chartId = 'apexChart'
being assigned a default value. Hencewill never append a random string.
Changing the property to
protected static ?string $chartId
will do the trick but I'm not sure if this leads to unwanted side effects.If you think making the property nullable will do the trick, I'm happy to submit a PR.