From the link I provided earlier see:-
Create a PivotChart - Excel for Microsoft 365
It’s important to set up the data as shown in the Workbook I provided in the Worksheet called:-
orig_data
Note that these are Text and Number columns.
Range I used to create the Pivot Chart was:-
A7:B29