Accepted answer

You need to create the svg element with svg namespace uri for it to support path when creating directly with JavaScript:

  var svg = document.createElementNS('','svg');

Instead of just the typical

var svg = document.createElement('svg');

Alternatively, you could use D3 to append the svg, which will make sure it's correctly namespaced!'svg').attr('id', 'donut');

More Query from same tag