Add a legend to stock chart from a random piece of JS I found online because I don't feel like figuring it out myself.