Is there any easy way to create a shape like a rhombus in raphael? I suppose there’s no command like:
var paper = new Raphael(document.getElementById('canvas_container'), 600, 600);
var rhombus = paper.rhombus(...);
Maybe there’s an easier way than drawing path. Any idea?
There is nothing like
paper.rhombusin Raphael. But you are free to extend the Raphael, so that you get rhombus method, as you have asked.I have created small fiddle for drawing the rhombus, in the same way you would like.
sample code from the fiddle.
Variable explanation:
learned much about rhombus 🙂