RGraph: HTML5 canvas graph library - Funnel chart documentation

This is a funnel chart. It can be used to illustrate stages of a sales or order fulfillment process, and in doing so highlight any bottlenecks or steps where large amounts of customers are lost.

The example file is here.

    window.onload = function ()
        var funnel = new RGraph.Funnel('funnel1', [100,45,45,26,21,5]);
        funnel.Set('chart.text.boxed', false);
        funnel.Set('chart.title', 'Leads through to sales');
        funnel.Set('chart.labels', ['A', 'B', 'C', 'D', 'E', 'F']);
        funnel.Set('chart.shadow', true);

Available properties

You can use these properties to control how the Funnel chart appears. You can set them by using the Set() method. Eg:

myFunnel.Set('name', 'value');

chart.gutter The gutter of the chart. This is the whitespace area around the chart.
Default: 25
chart.colors These are the colors used for each segment.
Default: ['red', 'green', 'gray', 'blue', 'black', 'white']
chart.labels An array of the labels to be used on the graph.
Default: An empty array
chart.text.font The font used to render the text.
Default: Verdana
chart.text.color The color of the labels.
Default: black
chart.text.size The size (in points) of the labels.
Default: 10
chart.text.boxed Whether the text is contained within a white bounding box. In some cases this can help readability.
Default: true
chart.text.halign The horizontal alignment of the text. Can be center or left.
Default: left
chart.title The title of the graph, if any.
Default: null
chart.title.vpos This allows you to completely override the vertical positioning of the title. It should be a number between 0 and 1, and is multiplied with the gutter and then used as the vertical position. It can be useful if you need to have a large gutter.
Default: null
chart.title.color The color of the title.
Default: black
chart.shadow Whether a drop shadow is applied to the Funnel chart. The funnel is the first to use the canvas shadow API, and as such they won't be supported on all browsers. Currently only Safari 4+ (possibly earlier versions too), Firefox 3.5+ and Chrome 2+ support canvas shadows.
Default: false
chart.shadow.color The color of the drop shadow.
Default: #666
chart.shadow.blur The severity of the shadow blurring effect.
Default: 3
chart.shadow.offsetx The X offset of the shadow.
Default: 3
chart.shadow.offsety The Y offset of the shadow.
Default: 3
chart.contextmenu An array of context menu items. More information on context menus is here.
Default: [] (An empty array)
chart.key An array of informational texts to be used as the key
Default: [] (An empty array)
chart.key.position This determines where the key is drawn. It can be "graph" or "gutter".
Default: graph
chart.key.background This is the colour used for the background of the key.
Default: #fff
chart.key.shadow Whether a small drop shadow is applied to the key.
Default: false
chart.tooltips An array of tooltips for the Funnel chart segments.
Default: null
chart.tooltip.effect The animated effect that tooltips use - fade or expand
Default: fade
chart.annotatable Whether annotations are enabled for the chart (ie you can draw on the chart interactively.
Default: false
chart.annotate.color If you do not allow the use of the palette, then this will be the only colour allowed for annotations.
Default: black
chart.zoom.mode Can be used to control whether the zoom is in thumbnail or canvas mode. Possible values are: thumbnail and canvas.
Default: canvas
chart.zoom.factor This is the factor that the graph will be zoomed by (bigger values means more zoom)
Default: 1.5
chart.zoom.fade.in Whether the zoomed canvas fades in or not. This also can be used to control the fade in for the zoom in thumbnail mode.
Default: true
chart.zoom.fade.out Whether the zoomed canvas fades out or not. This also can be used to control the fade in for the zoom in thumbnail mode.
Default: true
chart.zoom.hdir The horizontal direction of the zoom. Possible values are: left, center, right
Default: right
chart.zoom.vdir The vertical direction of the zoom. Possible values are: up, center, down
Default: down
chart.zoom.delay The delay (in milliseconds) between frames.
Default: 50
chart.zoom.frames The number of frames in the zoom animation.
Default: 10
chart.zoom.shadow Whether or not the zoomed canvas has a shadow or not.
Default: true
chart.zoom.thumbnail.width When the zoom is in thumbnail mode, this is the width (in pixels) of the thumbnail.
Default: 75
chart.zoom.thumbnail.height When the zoom is in thumbnail mode, this is the height (in pixels) of the thumbnail.
Default: 75