Click the 'full code' link right before the first graph to see all the code. I used an attribute map…