Finished demo code with chart display tweak