WIP: refactor chart plotting.