updated to handle streaming and custom chart options