The first onload event handler is being replaced by the second one and hence only one chart is getting created. Instead of assigning event handler twice, you should create both charts inside the same event handler as shown below.