James Dyson, the inventor of the bagless vacuum cleaner, has canceled his ambitious plan to build an electric car because the project was not commercially viable.