أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
SVG is better.Canvas is immediate drawing mode API.
But SVG is the creature of DOM.Possible to use JavaScript events automatically.
SVG is an earlier standard for drawing shapes in browsers. However, SVG is at a fundamentally higher level because each drawn shape is remembered as an object in a scene graph or DOM, which is subsequently rendered to a bit map. This means that if attributes of an SVG object are changed, the browser can automatically re-render the scene.
SVG is an earlier standard for drawing shapes in browsers. However, SVG is at a fundamentally higher level because each drawn shape is remembered as an object in a scene graph or DOM, which is subsequently rendered to a bit map. This means that if attributes of an SVG object are changed, the browser can automatically re-render the scene.
SVG images are represented in XML, and complex scenes can be created and maintained with XML editing tools.
The SVG scene graph enables event handlers to be associated with objects, so a rectangle may respond to an onClick event. To get the same functionality with canvas, one must manually match the coordinates of the mouse click with the coordinates of the drawn rectangle to determine whether it was clicked.
Conceptually, canvas is a lower level protocol upon which SVG might be built. However, this is not (normally) the case—they are independent standards. The situation is complicated because there are scene graph libraries for Canvas, and SVG has some bit map manipulation functionality.
You should use Canvas for:
You should use SVG for:
I prefer SVG's and there is a lot of plugins like http://www.jchartfx.com/ & http://benpickles.github.io/peity/ but it is easier to use Canvas such as chartjs.org
in this article they describe the difference in details https://msdn.microsoft.com/en-us/hh552482.aspx
Good luck
SVG is the most controllable