1 <?php ob_start('ob_gzhandler') ?>
5 <meta http-equiv="X-UA-Compatible" content="chrome=1">
8 * o------------------------------------------------------------------------------o
9 * | This file is part of the RGraph package - you can learn more at: |
11 * | http://www.rgraph.net |
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 personal, |
15 * | charity and educational purposes it is free to use. You can read the full |
17 * | http://www.rgraph.net/LICENSE.txt |
18 * o------------------------------------------------------------------------------o
21 <title>RGraph: HTML5 canvas graph library - progress bar documentation</title>
22 <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
23 <link rel="icon" type="image/png" href="/favicon.png">
27 <!-- Social networking buttons -->
28 <script src="../libraries/RGraph.common.core.js" ></script>
31 function HideTwitterDIV ()
33 document.getElementById("twitter_div").style.opacity = 0;
34 document.getElementById("twitter_div").style.display = 'none';
38 function ShowTwitterDIV (e)
40 var e = RGraph.FixEventObject(document.all ? event : e);
41 var div = document.getElementById("twitter_div");
42 var img = document.getElementById("twitter_icon");
44 div.style.display = 'block';
45 div.style.left = (RGraph.getCanvasXY(img)[0] + img.offsetWidth - div.offsetWidth + 110) + 'px';
46 div.style.top = (RGraph.getCanvasXY(img)[1] - 1) + 'px';
51 setTimeout('document.getElementById("twitter_div").style.opacity = 0.2;', 25);
52 setTimeout('document.getElementById("twitter_div").style.opacity = 0.4;', 50);
53 setTimeout('document.getElementById("twitter_div").style.opacity = 0.6;', 100);
54 setTimeout('document.getElementById("twitter_div").style.opacity = 0.8;', 125);
55 setTimeout('document.getElementById("twitter_div").style.opacity = 1.0;', 150);
63 * This code installs the event handler that hides the Twitter DIV
66 window.attachEvent('onload', function () {document.body.attachEvent('onclick', HideTwitterDIV);});
68 window.addEventListener('click', HideTwitterDIV, false);
72 <!-- The twitter DIV -->
73 <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;">
74 <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">Tweet about RGraph</a><br>
75 <a href="http://twitter.com/_rgraph" style="text-decoration: none" rel="nofollow" target="_blank">Follow for HTML5 news</a>
78 <div id="social_icons" class="warning" style="top: 0; left: 5px; position: absolute">
81 if (navigator.userAgent.indexOf('Opera') == -1) {
82 document.getElementById("social_icons").style.position = 'fixed';
83 document.getElementById("twitter_div").style.position = 'fixed';
88 <b style="display: inline-block; position: relative; top: 1px">Bookmark and share:</b>
92 <a title="Bookmark with delicious" href="http://delicious.com/save?jump=close&v=4&noui&jump=close&url=http://www.rgraph.net¬es=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">
93 <img src="../images/delicious.png" alt="Bookmark with delicious" width="22" height="22" border="0" align="absmiddle" />
96 <a href="" target="_blank" onmouseover="if (document.getElementById('twitter_div').style.display == 'none') ShowTwitterDIV(event);" onclick="event.stopPropagation(); event.cancelBubble = true; return false">
97 <img src="../images/twitter.png" id="twitter_icon" alt="tweet this site" width="22" height="22" border="0" align="absmiddle" />
102 <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">
103 <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"/>
107 <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">
108 <img src="../images/facebook.png" width="22" height="22" alt="Post to Facebook" align="absmiddle" style="position: relative; top: -2px; border: 0" border="0"/>
111 <a href="mailto:share@friendfeed.com" title="Share on FriendFeed">
112 <img src="../images/friendfeed.png" width="22" height="22" alt="Share on FriendFeed" border="0" align="absmiddle" />
115 <a href="http://www.stumbleupon.com/submit?url=http://www.rgraph.net" target="_blank" title="Share on StumbleUpon" >
116 <img src="../images/stumble.png" alt="Stumble! this site" width="22" height="22" border="0" align="absmiddle" />
121 <!-- /Social networking buttons -->
123 <div id="breadcrumb">
124 <a href="../index.html">RGraph: HTML5 canvas graph library</a>
126 <a href="index.html">Documentation</a>
128 Vertical Progress bar
131 <h1>RGraph: HTML5 canvas graph library - Vertical Progress bar documentation</h1>
134 if (RGraph.isIE8()) {
135 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 The example file is <a href="../examples/vprogress.html">here</a>.
145 window.onload = function ()
147 var myProgress = new RGraph.VProgess('myProgress', 78, 100);
148 myProgress.Set('chart.colors', ['red']);
157 You can use these properties to control how the progress bar apears. You can set them by using the Set() method. Eg:
161 <b>myProgress.Set('name', 'value');</b>
165 <li><a href="#chart configuration">Chart configuration</a></li>
166 <li><a href="#margins">Margins</a></li>
167 <li><a href="#colors">Colors</a></li>
168 <li><a href="#shadow">Shadow</a></li>
169 <li><a href="#labels and text">Labels and text</a></li>
170 <li><a href="#scale">Scale</a></li>
171 <li><a href="#titles">Titles</a></li>
172 <li><a href="#interactive features">Interactive features</a></li>
173 <li><a href="#zoom">Zoom</a></li>
177 <a name="chart configuration"></a>
178 <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">Chart configuration</h3> <a name="chart.tickmarks"></a>
179 <b>chart.tickmarks</b><br />
180 Whether the tickmarks are drawn. <br /><i>Default: true</i><br /><br />
182 <a name="chart.labels.count"></a>
183 <b>chart.labels.count</b><br />
184 This controls how many labels there are.
185 <br /><i>Default: 10</i><br /><br />
187 <a name="chart.tickmarks.color"></a>
188 <b>chart.tickmarks.color</b><br />
189 The color used for tickmarks.<br /><i>Default: black</i><br /><br />
191 <a name="chart.tickmarks.inner"></a>
192 <b>chart.tickmarks.inner</b><br />
193 This controls whether the bar has inner tickmarks<br /><i>Default: false</i><br /><br />
195 <a name="chart.value"></a>
196 <b>chart.value</b><br />
197 The indicated value. You don't need to set this because it's one of the arguments to the constructor.<br />
198 <i>Default: none (An argument to the constructor)</i>
201 <a name="chart.min"></a>
202 <b>chart.min</b><br />
203 The minimum value. Setting a minimum value allows to show a more detailed progress bar.<BR />
204 <i>Default: 0</i><br /><br />
206 <a name="chart.max"></a>
207 <b>chart.max</b><br />
208 The maximum value. You don't need to set this because it's one of the arguments to the constructor.<br /><br />
210 <a name="chart.numticks"></a>
211 <b>chart.numticks</b><br />
212 How many tick marks there are. <br /><i>Default: 10</i><br /><br />
213 <a name="chart.numticks.inner"></a>
214 <b>chart.numticks.inner</b><br />
215 How many inner tick marks there are. <br /><i>Default: 50</i><br /><br />
216 <a name="chart.arrows"></a>
217 <b>chart.arrows</b><br />
218 This stipulates that two indicator arrows are drawn. It works best if you have tickmarks off, and no title.<br><i>Default: false</i><br /><br />
219 <a name="margins"></a>
220 <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>
221 <b>chart.gutter</b><br />
222 The size of the gutter. <br /><i>Default: 25</i><br /><br />
223 <a name="colors"></a>
224 <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.color"></a>
225 <b>chart.color</b><br />
226 The color of the bar. This can be a solid color, or a gradient that you create. <br /><i>Default: #0c0</i><br /><br />
227 <a name="chart.background.color"></a>
228 <b>chart.background.color</b><br />
229 The background color. <br /><i>Default: #eee</i><br /><br />
230 <a name="shadow"></a>
231 <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>
232 <b>chart.shadow</b><br />
233 Whether the progress bar has a shadow. This uses the canvas shadow API and therefore is only supported on Chrome 2, Safari 3.1 and Firefox 3.1 (and above).<br /><i>Default: false</i><br /><br />
234 <a name="chart.shadow.offsetx"></a>
235 <b>chart.shadow.offsetx</b><br />
236 The X offset of the progress bar shadow.<br /><i>Default: 3</i><br /><br />
237 <a name="chart.shadow.offsety"></a>
238 <b>chart.shadow.offsety</b><br />
239 The Y offset of the progress bar shadow.<br /><i>Default: 3</i><br /><br />
240 <a name="chart.shadow.color"></a>
241 <b>chart.shadow.color</b><br />
242 The color of the shadow.<br /><i>Default: rgba(0,0,0,0.5)</i><br /><br />
243 <a name="chart.shadow.blur"></a>
244 <b>chart.shadow.blur</b><br />
245 The blurring effect that is applied to the shadow.<br /><i>Default: 3</i><br /><br />
246 <a name="labels and text"></a>
247 <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.text.font"></a>
248 <b>chart.text.font</b><br />
249 The font used to render the text.<br /><i>Default: Verdana</i><br /><br />
250 <a name="chart.text.color"></a>
251 <b>chart.text.color</b><br />
252 The color of the labels. <br /><i>Default: black</i><br /><br />
253 <a name="chart.text.size"></a>
254 <b>chart.text.size</b><br />
255 The size of the text (in points). <br /><i>Default: 10</i><br /><br />
257 <a name="chart.labels"></a>
258 <b>chart.labels</b><br />
259 Labels that are applied to the graph. <br /><i>Default: An empty array</i><br /><br />
261 <a name="chart.labels.position"></a>
262 <b>chart.labels.position</b><br />
263 Can be <i>left</i> or <i>right</i> and controls which side the labels are positioned on.<br />
264 <i>Default: right</i><br /><br />
268 <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">Scale</h3> <a name="chart.units.pre"></a>
269 <b>chart.units.pre</b><br />
270 The units that the Y scale is measured in (these are preppend to the number). <br /><i>Default: none</i><br /><br />
272 <a name="chart.units.post"></a>
273 <b>chart.units.post</b><br />
274 The units that the Y scale is measured in (these are appended to the number). <br /><i>Default: none</i><br /><br />
276 <a name="chart.scale.decimals"></a>
277 <b>chart.scale.decimals</b><br />
278 This stipulates how many decimal places there are.
279 <br /><i>Default: 0</i><br /><br />
282 <a name="titles"></a>
283 <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>
284 <b>chart.title</b><br />
285 The title of the progress bar. <br /><i>Default: An empty string</i><br /><br />
286 <a name="chart.title.hpos"></a>
287 <b>chart.title.hpos</b><br />
288 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 />
289 <a name="chart.title.vpos"></a>
290 <b>chart.title.vpos</b><br />
291 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 />
292 <a name="chart.title.color"></a>
293 <b>chart.title.color</b><br />
294 The color of the title.<br /> <i>Default: black</i><br /><br />
295 <a name="interactive features"></a>
296 <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.tooltips"></a>
297 <b>chart.tooltips</b><br />
298 An array, albeit one element only. This is shown when the progress bar is clicked on. Tooltips can contain HTML.<br /><i>Default: An empty array</i><br /><br />
299 <a name="chart.tooltips.effect"></a>
300 <b>chart.tooltips.effect</b><br />
301 The animated effect used for showing the tooltip. Can be either <i>fade</i> or <i>expand</i>.<br /><i>Default: fade</i><br /><br />
302 <a name="chart.tooltips.css.class"></a>
303 <b>chart.tooltips.css.class</b><br />
304 This is the name of the CSS class the graph uses.<br /><i>Default: RGraph_tooltip</i><br /><br />
306 <a name="chart.tooltips.override"></a>
307 <b>chart.tooltips.override</b><br />
308 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 />
309 <i>Default: null</i><br /><br />
311 <a name="chart.tooltips.coords.adjust"></a>
312 <b>chart.tooltips.coords.adjust</b><br />
313 If you translate to gain space, then you can use this to tell RGraph that you have, so that the coordinates for the
314 tooltip(s) are accurate.<br />
315 <i>Default: [0, 0]</i><br /><br />
317 <a name="chart.contextmenu"></a>
318 <b>chart.contextmenu</b><br />
319 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 />
320 <a name="chart.annotatable"></a>
321 <b>chart.annotatable</b><br />
322 Whether annotations are enabled for the chart (ie you can draw on the chart interactively.<br /><i>Default: false</i><br /><br />
323 <a name="chart.annotate.color"></a>
324 <b>chart.annotate.color</b><br />
325 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 />
326 <a name="chart.resizable"></a>
327 <b>chart.resizable</b><br />
328 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 />
329 <a name="chart.adjustable"></a>
330 <b>chart.adjustable</b><br />
331 Defaulting to false, this determines whether your progress bar will be adjustable (click the bar and drag it). <br /><i>Default: false</i><br /><br />
333 <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.factor"></a>
334 <b>chart.zoom.factor</b><br />
335 This is the factor that the graph will be zoomed by (bigger values means more zoom)<br /><i>Default: 1.5</i><br /><br />
336 <a name="chart.zoom.fade.in"></a>
337 <b>chart.zoom.fade.in</b><br />
338 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 />
339 <a name="chart.zoom.fade.out"></a>
340 <b>chart.zoom.fade.out</b><br />
341 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 />
342 <a name="chart.zoom.hdir"></a>
343 <b>chart.zoom.hdir</b><br />
344 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 />
345 <a name="chart.zoom.vdir"></a>
346 <b>chart.zoom.vdir</b><br />
347 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 />
348 <a name="chart.zoom.delay"></a>
349 <b>chart.zoom.delay</b><br />
350 The delay (in milliseconds) between frames.<br /><i>Default: 50</i><br /><br />
351 <a name="chart.zoom.frames"></a>
352 <b>chart.zoom.frames</b><br />
353 The number of frames in the zoom animation.<br /><i>Default: 10</i><br /><br />
354 <a name="chart.zoom.shadow"></a>
355 <b>chart.zoom.shadow</b><br />
356 Whether or not the zoomed canvas has a shadow or not.<br /><i>Default: true</i><br /><br />
357 <a name="chart.zoom.background"></a>
358 <b>chart.zoom.background</b><br />
359 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 />
360 </div><!-- /DOCS --><br /><br />