initial commit
[home-automation.git] / RGraph / docs / funnel.html
1 <?php ob_start('ob_gzhandler') ?>
2 <!DOCTYPE html>
3 <html>
4 <head>
5     <meta http-equiv="X-UA-Compatible" content="chrome=1">
6     <!--
7         /**
8         * o------------------------------------------------------------------------------o
9         * | This file is part of the RGraph package - you can learn more at:             |
10         * |                                                                              |
11         * |                          http://www.rgraph.net                               |
12         * |                                                                              |
13         * | This package is licensed under the RGraph license. For all kinds of business |
14         * | purposes there is a small one-time licensing fee to pay and for non          |
15         * | commercial  purposes it is free to use. You can read the full license here:  |
16         * |                                                                              |
17         * |                      http://www.rgraph.net/LICENSE.txt                       |
18         * o------------------------------------------------------------------------------o
19         */
20     -->
21     <title>RGraph: HTML5 canvas graph library - funnel chart documentation</title>
22     
23     <meta name="keywords" content="rgraph html5 canvas graph docs funnel chart" />
24     <meta name="description" content="RGraph: HTML5 canvas graph software - Documentation about the Funnel chart" />
25
26     <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
27     <link rel="icon" type="image/png" href="../images/favicon.png">
28 </head>
29 <body>
30
31
32     <!-- Social networking buttons -->
33     <script src="../libraries/RGraph.common.core.js" ></script>
34     
35     <script>
36         function HideTwitterDIV ()
37         {
38             document.getElementById("twitter_div").style.opacity = 0;
39             document.getElementById("twitter_div").style.display = 'none';
40         }
41
42
43         function ShowTwitterDIV (e)
44         {
45             var e   = RGraph.FixEventObject(document.all ? event : e);
46             var div = document.getElementById("twitter_div");
47             var img = document.getElementById("twitter_icon");
48
49             div.style.display = 'block';
50             div.style.left    = (RGraph.getCanvasXY(img)[0] + img.offsetWidth - div.offsetWidth + 110) + 'px';
51             div.style.top     = (RGraph.getCanvasXY(img)[1] - 1) + 'px';
52
53             /**
54             * Fade it in
55             */
56             setTimeout('document.getElementById("twitter_div").style.opacity = 0.2;', 25);
57             setTimeout('document.getElementById("twitter_div").style.opacity = 0.4;', 50);
58             setTimeout('document.getElementById("twitter_div").style.opacity = 0.6;', 100);
59             setTimeout('document.getElementById("twitter_div").style.opacity = 0.8;', 125);
60             setTimeout('document.getElementById("twitter_div").style.opacity = 1.0;', 150);
61
62             e.stopPropagation();
63
64             return false;
65         }
66
67         /**
68         * This code installs the event handler that hides the Twitter DIV
69         */
70         if (RGraph.isIE8()) {
71              window.attachEvent('onload', function () {document.body.attachEvent('onclick', HideTwitterDIV);});
72         } else {
73             window.addEventListener('click', HideTwitterDIV, false);
74         }
75     </script>
76
77     <!-- The twitter DIV --> 
78     <div id="twitter_div" style="position: absolute;top: 0;left: 0;background-color: #eee;border: 2px dashed black;box-shadow: 0 0 15px #aaa;-moz-box-shadow: 0 0 15px #aaa;-webkit-box-shadow: 0 0 15px #aaa;padding: 3px;display: none;opacity: 0;z-index: 99;"> 
79         <a href="http://twitter.com/home/?status=RGraph%3A+HTML5+canvas+graph+library+based+on+the+HTML5+canvas+tag+http%3A%2F%2Fwww.rgraph.net+%23rgraph+%23html5+%23canvas" target="_blank" title="Share on Twitter" rel="nofollow" style="text-decoration: none"><b>Tweet&nbsp;about&nbsp;RGraph</b></a><br>
80         <a href="http://twitter.com/_rgraph" style="text-decoration: none" rel="nofollow" target="_blank">Follow for HTML5 news</a> 
81     </div>
82
83     <div id="social_icons" class="warning" style="top: 0; left: 5px; position: absolute">
84         <script>
85             // Opera fix
86             if (navigator.userAgent.indexOf('Opera') == -1) {
87               document.getElementById("social_icons").style.position = 'fixed';
88               document.getElementById("twitter_div").style.position = 'fixed';
89     
90             }
91         </script>
92     
93         <b style="display: inline-block; position: relative; top: 1px">Bookmark and share:</b>
94     
95     
96             <div id="social">
97                 <a title="Bookmark with delicious" href="http://delicious.com/save?jump=close&v=4&noui&jump=close&url=http://www.rgraph.net&notes=RGraph%20is%20a%20HTML5%20based%20graph%20library%20supporting%20a%20wide%20range%20of%20different%20graph%20types:Bar,%20Bipolar,%20Donut,%20Funnel,%20Gantt,%20Horizontal%20Bar,%20LED,%20Line,%20Meter,%20Odometer,%20Pie,%20Progress%20Bar,%20Rose,%20RScatter,%20Scatter%20and%20Traditional%20Radar&title=RGraph:%20HTML5%20canvas%20graph%20library%20based%20on%20the%20HTML5%20canvas%20tag" target="_blank">
98                     <img src="../images/delicious.png" alt="Bookmark with delicious" width="22" height="22" border="0" align="absmiddle" /> 
99                 </a> 
100      
101                 <a href="" target="_blank" onmouseover="if (document.getElementById('twitter_div').style.display == 'none') ShowTwitterDIV(event);" onclick="event.stopPropagation(); event.cancelBubble = true; return false">
102                     <img src="../images/twitter.png" id="twitter_icon" alt="tweet this site" width="22" height="22" border="0" align="absmiddle" />
103                 </a>
104     
105     
106 <!--
107                 <a title="Post to Google Buzz!" href="" onclick="window.open('http://www.google.com/buzz/post?url=http://www.rgraph.net&imageurl=http://www.rgraph.net/images/logo.png', 'google_buzz_window', 'width=800,height=400,top=100,left=100'); return false">
108                     <img src="../images/buzz.png" width="22" height="22" alt="Post to Google Buzz!" align="absmiddle" style="position: relative; top: -2px; border: 0" border="0"/>
109                 </a>
110     
111     
112                 <a title="Share RGraph on Facebook" href="" onclick="window.open('http://www.facebook.com/sharer.php?u=http://www.rgraph.net&t=RGraph:%20HTML5%20canvas%20graph%20library', 'facebook_window', 'width=500,height=300,top=100,left=100'); return false">
113                     <img src="../images/facebook.png" width="22" height="22" alt="Post to Facebook" align="absmiddle" style="position: relative; top: -2px; border: 0" border="0"/>
114                 </a>
115     
116                 <a href="mailto:share@friendfeed.com" title="Share on FriendFeed"> 
117                     <img src="../images/friendfeed.png" width="22" height="22" alt="Share on FriendFeed" border="0" align="absmiddle" /> 
118                 </a>
119     
120                 <a href="http://www.stumbleupon.com/submit?url=http://www.rgraph.net" target="_blank" title="Share on StumbleUpon" >
121                     <img src="../images/stumble.png" alt="Stumble! this site" width="22" height="22" border="0" align="absmiddle" /> 
122                 </a>
123 -->
124             </div>
125     </div>
126     <!-- /Social networking buttons -->
127
128     <div id="breadcrumb">
129         <a href="../index.html">RGraph: HTML5 canvas graph library</a>
130         >
131         <a href="index.html">Documentation</a>
132         >
133         Funnel chart
134     </div>
135
136     <h1>RGraph: HTML5 canvas graph library - Funnel chart documentation</h1>
137     <script>
138         if (RGraph.isIE8()) {
139             document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer 8 does not natively support the HTML5 canvas tag, so if you want to see the graphs, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the RGraph Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag. Click <a href="http://groups.google.com/group/rgraph/browse_thread/thread/c5651ff8c56b8f3c#" target="_blank">here</a> to see some screenshots.</div>');
140         }
141     </script>
142
143     <p>
144         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
145         or steps where large amounts of customers are lost.
146     </p>
147     
148     <p> 
149         The example file is <a href="../examples/funnel.html">here</a>.
150     </p> 
151     
152     <pre class="code">
153 &lt;script&gt;
154     window.onload = function ()
155     {
156         var funnel = new RGraph.Funnel('funnel1', [100,45,45,26,21,5]);
157         funnel.Set('chart.text.boxed', false);
158         funnel.Set('chart.title', 'Leads through to sales');
159         funnel.Set('chart.labels', ['A', 'B', 'C', 'D', 'E', 'F']);
160         funnel.Set('chart.shadow', true);
161         funnel.Draw();
162     }
163 &lt;/script&gt;
164 </pre>
165
166
167     <h2>Properties</h2>
168     
169     <p>
170         You can use these properties to control how the Funnel chart appears. You can set them by using the Set() method. Eg:
171     </p>
172     
173     <p>
174         <b>myFunnel.Set('name', 'value');</b>
175     </p>
176     
177     <ul>
178         <li><a href="#margins">Margins</a></li>
179         <li><a href="#colors">Colors</a></li>
180         <li><a href="#labels and text">Labels and text</a></li>
181         <li><a href="#titles">Titles</a></li>
182         <li><a href="#shadow">Shadow</a></li>
183         <li><a href="#interactive features">Interactive features</a></li>
184         <li><a href="#key">Key</a></li>
185         <li><a href="#zoom">Zoom</a></li>
186     </ul>
187
188 <a name="margins"></a>
189 <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Margins</h3>            <a name="chart.gutter"></a>
190 <b>chart.gutter</b><br />
191             The gutter of the chart. This is the whitespace area around the chart.<br /><i>Default: 25</i><br /><br />
192 <a name="colors"></a>
193 <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Colors</h3>            <a name="chart.colors"></a>
194 <b>chart.colors</b><br />
195             These are the colors used for each segment.<br /><i>Default: ['red', 'green', 'gray', 'blue', 'black', 'white']</i><br /><br />
196 <a name="labels and text"></a>
197 <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Labels and text</h3>            <a name="chart.labels"></a>
198 <b>chart.labels</b><br />
199             An array of the labels to be used on the graph. <br /><i>Default: An empty array</i><br /><br />
200             <a name="chart.text.font"></a>
201 <b>chart.text.font</b><br />
202             The font used to render the text.<br /><i>Default: Verdana</i><br /><br />
203             <a name="chart.text.color"></a>
204 <b>chart.text.color</b><br />
205             The color of the labels. <br /><i>Default: black</i><br /><br />
206             <a name="chart.text.size"></a>
207 <b>chart.text.size</b><br />
208             The size (in points) of the labels. <br /><i>Default: 10</i><br /><br />
209             <a name="chart.text.boxed"></a>
210 <b>chart.text.boxed</b><br />
211             Whether the text is contained within a white bounding box. In some cases this can help readability.<br /><i>Default: true</i><br /><br />
212             <a name="chart.text.halign"></a>
213 <b>chart.text.halign</b><br />
214             The horizontal alignment of the text. Can be <i>center</i> or <i>left</i>.<br /><i>Default: left</i><br /><br />
215 <a name="titles"></a>
216 <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Titles</h3>            <a name="chart.title"></a>
217 <b>chart.title</b><br />
218             The title of the graph, if any. <br /><i>Default: null</i><br /><br />
219
220 <a name="chart.title.background"></a>
221 <b>chart.title.background</b><br />
222 The background color (if any) for the title.<br />
223 <i>Default: null</i><br /><br />
224
225             <a name="chart.title.hpos"></a>
226 <b>chart.title.hpos</b><br />
227             This allows you to completely override the horizontal positioning of the title. It should be a number between 0 and 1, and is multiplied with the whole width of the canvas and then used as the horizontal position. <br /><i>Default: null</i><br /><br />
228             <a name="chart.title.vpos"></a>
229 <b>chart.title.vpos</b><br />
230             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.<br /><i>Default: null</i><br /><br />
231             <a name="chart.title.color"></a>
232 <b>chart.title.color</b><br />
233             The color of the title.<br /> <i>Default: black</i><br /><br />
234 <a name="shadow"></a>
235 <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Shadow</h3>            <a name="chart.shadow"></a>
236 <b>chart.shadow</b><br />
237             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.<br /><i>Default: false</i><br /><br />
238             <a name="chart.shadow.color"></a>
239 <b>chart.shadow.color</b><br />
240             The color of the drop shadow.<br /><i>Default: #666</i><br /><br />
241             <a name="chart.shadow.blur"></a>
242 <b>chart.shadow.blur</b><br />
243             The severity of the shadow blurring effect.<br /><i>Default: 3</i><br /><br />
244             <a name="chart.shadow.offsetx"></a>
245 <b>chart.shadow.offsetx</b><br />
246             The X offset of the shadow.<br /><i>Default: 3</i><br /><br />
247             <a name="chart.shadow.offsety"></a>
248 <b>chart.shadow.offsety</b><br />
249             The Y offset of the shadow.<br /><i>Default: 3</i><br /><br />
250 <a name="interactive features"></a>
251 <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Interactive features</h3>            <a name="chart.contextmenu"></a>
252 <b>chart.contextmenu</b><br />
253             An array of context menu items. More information on context menus is <a href="context.html">here</a>.<br /><i>Default: [] (An empty array)</i><br /><br />
254             <a name="chart.tooltips"></a>
255 <b>chart.tooltips</b><br />
256             An array of tooltips for the Funnel chart segments.<br /><i>Default: null</i><br /><br />
257             <a name="chart.tooltips.effect"></a>
258 <b>chart.tooltips.effect</b><br />
259             The animated effect that tooltips use - <i>fade</i> or <i>expand</i><br /><i>Default: fade</i><br /><br />
260             <a name="chart.tooltips.css.class"></a>
261 <b>chart.tooltips.css.class</b><br />
262             This is the name of the CSS class the graph uses.<br /><i>Default: RGraph_tooltip</i><br /><br />
263             <a name="chart.tooltips.override"></a>
264 <b>chart.tooltips.override</b><br />
265             If you wish to handle showing tooltips yourself, this should be a function object which does just that. There's more information on the <a href="tooltips.html">tooltips documentation page</a><br /><i>Default: null</i><br /><br />
266             <a name="chart.annotatable"></a>
267 <b>chart.annotatable</b><br />
268             Whether annotations are enabled for the chart (ie you can draw on the chart interactively.<br /><i>Default: false</i><br /><br />
269             <a name="chart.annotate.color"></a>
270 <b>chart.annotate.color</b><br />
271             If you do not allow the use of the palette, then this will be the only colour allowed for annotations.<br /><i>Default: black</i><br /><br />
272             <a name="chart.resizable"></a>
273 <b>chart.resizable</b><br />
274             Defaulting to false, this determines whether your graph will be resizable. Because of the numerous event handlers this has to install code on, This feature is unlikely to work with other dynamic features (the context menu is fine however).<br /><i>Default: false</i><br /><br />
275
276
277
278             <a name="key"></a>
279             <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Key</h3>
280             
281             <a name="chart.key"></a>
282             <b>chart.key</b><br />
283             An array of key information. <br />
284             <i>Default: [] (An empty array)</i><br /><br />
285
286             <a name="chart.key.background"></a>
287             <b>chart.key.background</b><br />
288             The color of the key background. Typically white, you could set this to something like rgba(255,255,255,0.7) to allow people to see things behind it.<br>
289             <i>Default: white</i><br /><br />
290             
291             <a name="chart.key.position"></a>
292             <b>chart.key.position</b><br />
293             Determines the position of the key.Either <b>graph</b> (default), or <b>gutter</b>.<br />
294             <i>Default: graph</i><br /><br />
295             
296             <b>chart.key.position.x</b><br />
297             This allows you to specify a specific X coordinate for the key.<br />
298             <i>Default: null</i><br /><br />
299             
300             <b>chart.key.position.y</b><br />
301             This allows you to specify a specific Y coordinate for the key.<br />
302             <i>Default: null</i><br /><br />
303             
304             <b>chart.key.position.gutter.boxed</b><br />
305             If you have the key in gutter mode (ie horizontal), this allows you to give a background color.<br />
306             <i>Default: true</i><br /><br />
307             
308             <a name="chart.key.shadow"></a>
309             <b>chart.key.shadow</b><br />
310             Whether a small drop shadow is applied to the key.<br />
311             <i>Default: false</i><br /><br />
312
313             <a name="chart.key.shadow.color"></a>
314             <b>chart.key.shadow.color</b><br />
315             The color of the shadow.<br />
316             <i>Default: #666</i><br /><br />
317
318             <a name="chart.key.shadow.blur"></a>
319             <b>chart.key.shadow.blur</b><br />
320             The extent of the blurring effect used on the shadow.<br />
321             <i>Default: 3</i><br /><br />
322
323             <a name="chart.key.shadow.offsetx"></a>
324             <b>chart.key.shadow.offsetx</b><br />
325             The X offset of the shadow.<br />
326             <i>Default: 2</i><br /><br />
327
328             <a name="chart.key.shadow.offsety"></a>
329             <b>chart.key.shadow.offsety</b><br />
330             The Y offset of the shadow.<br />
331             <i>Default: 2</i><br /><br />
332
333             <b>chart.key.rounded</b><br />
334             This controls whether the corners of the key (in graph mode) are curved. If the key is gutter mode, this has no effect.<br />
335             <i>Default: false</i><br /><br />
336             
337             <b>chart.key.color.shape</b><br />
338             This can be <i>square</i>, <i>circle</i> or <i>line</i> and controls how the color indicators in the key appear.<br />
339             <i>Default: square</i><br /><br />
340             
341             
342
343 <a name="zoom"></a>
344 <h3 style="border: 1px solid #aaa; background-color: #eee; font-style: italic; padding: 5px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px">Zoom</h3>            <a name="chart.zoom.mode"></a>
345 <b>chart.zoom.mode</b><br />
346             Can be used to control whether the zoom is in thumbnail or canvas mode. Possible values are: <i>thumbnail</i> and <i>canvas</i>.<br /><i>Default: canvas</i><br /><br />
347             <a name="chart.zoom.factor"></a>
348 <b>chart.zoom.factor</b><br />
349             This is the factor that the graph will be zoomed by (bigger values means more zoom)<br /><i>Default: 1.5</i><br /><br />
350             <a name="chart.zoom.fade.in"></a>
351 <b>chart.zoom.fade.in</b><br />
352             Whether the zoomed canvas fades in or not. This also can be used to control the fade in for the zoom in thumbnail mode.<br /><i>Default: true</i><br /><br />
353             <a name="chart.zoom.fade.out"></a>
354 <b>chart.zoom.fade.out</b><br />
355             Whether the zoomed canvas fades out or not. This also can be used to control the fade in for the zoom in thumbnail mode.<br /><i>Default: true</i><br /><br />
356             <a name="chart.zoom.hdir"></a>
357 <b>chart.zoom.hdir</b><br />
358             The horizontal direction of the zoom. Possible values are: <i>left</i>, <i>center</i>, <i>right</i><br /><i>Default: right</i><br /><br />
359             <a name="chart.zoom.vdir"></a>
360 <b>chart.zoom.vdir</b><br />
361             The vertical direction of the zoom. Possible values are: <i>up</i>, <i>center</i>, <i>down</i><br /><i>Default: down</i><br /><br />
362             <a name="chart.zoom.delay"></a>
363 <b>chart.zoom.delay</b><br />
364             The delay (in milliseconds) between frames.<br /><i>Default: 50</i><br /><br />
365             <a name="chart.zoom.frames"></a>
366 <b>chart.zoom.frames</b><br />
367             The number of frames in the zoom animation.<br /><i>Default: 10</i><br /><br />
368             <a name="chart.zoom.shadow"></a>
369 <b>chart.zoom.shadow</b><br />
370             Whether or not the zoomed canvas has a shadow or not.<br /><i>Default: true</i><br /><br />
371             <a name="chart.zoom.thumbnail.width"></a>
372 <b>chart.zoom.thumbnail.width</b><br />
373             When the zoom is in thumbnail mode, this is the width (in pixels) of the thumbnail.<br /><i>Default: 75</i><br /><br />
374             <a name="chart.zoom.thumbnail.height"></a>
375 <b>chart.zoom.thumbnail.height</b><br />
376             When the zoom is in thumbnail mode, this is the height (in pixels) of the thumbnail.<br /><i>Default: 75</i><br /><br />
377             <a name="chart.zoom.background"></a>
378 <b>chart.zoom.background</b><br />
379             Defaulting to true, this determines whether the zoom has a dark, semi-opaque background that covers the entire web page.<br /><i>Default: true</i><br /><br />
380 </div><!-- /DOCS --><br /><br />
381 </body>
382 </html>