Set the title when adding a chart

Fixes #967