Deactivate 'draw chart' button during async task. In addition, improve legibilty by replacing multiple if's with 'case' statement