Clear Up
SharpKit Reference

Raphael.fn Property

You can add your own method to the canvas. For example if you want to draw a pie chart, you can create your own pie chart function and ship it as a Raphaël plugin. To do this you need to extend the Raphael.fn object. You should modify the fn object before a Raphaël instance is created, otherwise it will take no effect. Please note that the ability for namespaced plugins was removed in Raphael 2.0. It is up to the plugin to ensure any namespacing ensures proper context.

Namespace: SharpKit.Raphael

Class: Raphael


public object fn { get; set; }

Return Value

Type: System.Object


Raphael.fn.arrow = function (x1, y1, x2, y2, size) {
return this.path( ... );
// or create namespace
Raphael.fn.mystuff = {
arrow: function () {…},
star: function () {…},
// etc…
var paper = Raphael(10, 10, 630, 480);
// then use it
paper.arrow(10, 10, 30, 30, 5).attr({fill: "#f00"});
© Copyright 2005-2011 SharpKit. All rights reserved.