It should be possible if you create two new dimensions in the script based on the two you use in the chart. Suppose you have a dimension Product:
Product Apple Banana Chocolate
The new table would look like this:
ReportProduct Product Apple Apple Banana Banana Chocolate Chocolate Total Apple Total Banana Total Chocolate
Now you can use ReportProduct in the grid chart instead of Product to show the totals too.