Customizing the Report Bar Chart using scripting

I encountered this exact problem here in the forum a little while back. Here was the solution: