Dialog now closes after the chart has been built.