Fixed issue with adding X axis dynamically. Closes #1827.