I did my best using the code provide, it was a guess. I am just trying to show you how you would insert the field values into the data.
The content inside of data-bs-chart=""
is a JSON object. The JSON object can be constructed as a PHP array and then converted to a JSON object. This allows you to insert the values PHP array where they are needed.