Raw chart generation code