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: Javascript charts and graph library - odometer charts</title> |
---|
22 | |
---|
23 | <meta name="keywords" content="rgraph html5 canvas example odometer charts" /> |
---|
24 | <meta name="description" content="RGraph: Javascript charts and graph library - Odometer charts example" /> |
---|
25 | |
---|
26 | <meta property="og:title" content="RGraph: Javascript charts and graph library" /> |
---|
27 | <meta property="og:description" content="A charts library based on the HTML5 canvas tag" /> |
---|
28 | <meta property="og:image" content="http://www.rgraph.net/images/logo.png"/> |
---|
29 | |
---|
30 | <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" /> |
---|
31 | <link rel="icon" type="image/png" href="../images/favicon.png"> |
---|
32 | |
---|
33 | <script src="../libraries/RGraph.common.core.js" ></script> |
---|
34 | <script src="../libraries/RGraph.odo.js" ></script> |
---|
35 | <!--[if IE 8]><script src="../excanvas/excanvas.original.js"></script><![endif]--> |
---|
36 | |
---|
37 | <script> |
---|
38 | window.onload = function () |
---|
39 | { |
---|
40 | // ID, MINIMUM, MAXIMUM, INDICATED VALUE |
---|
41 | var odo1 = new RGraph.Odometer('odo1', 0, 12,9.5); |
---|
42 | odo1.Set('chart.labels', ['12', '1','2','3','4','5','6','7','8','9','10','11']); |
---|
43 | odo1.Set('chart.needle.thickness', 5); |
---|
44 | odo1.Set('chart.needle.color', 'black'); |
---|
45 | odo1.Set('chart.needle.extra', [[6, 'black', 50]]); |
---|
46 | odo1.Set('chart.needle.head', false); |
---|
47 | odo1.Set('chart.label.area', 40); |
---|
48 | odo1.Set('chart.shadow.outer', true); |
---|
49 | odo1.Set('chart.needle.tail', false); |
---|
50 | |
---|
51 | odo1.Set('chart.green.color', 'gray'); |
---|
52 | odo1.Set('chart.yellow.color', 'gray'); |
---|
53 | odo1.Set('chart.red.color', 'gray'); |
---|
54 | |
---|
55 | RGraph.AddCustomEventListener(odo1, 'ondraw', |
---|
56 | function (obj) |
---|
57 | { |
---|
58 | var context = obj.context; |
---|
59 | context.strokeStyle = 'black'; |
---|
60 | context.fillStyle = 'white'; |
---|
61 | context.beginPath(); |
---|
62 | context.moveTo(obj.centerx, obj.centery); |
---|
63 | context.arc(obj.centerx, obj.centery, 10, 0, 6.28, 0); |
---|
64 | context.stroke(); |
---|
65 | context.fill(); |
---|
66 | } |
---|
67 | ); |
---|
68 | |
---|
69 | odo1.Draw(); |
---|
70 | |
---|
71 | var odo2 = new RGraph.Odometer('odo2', 0, 360, 56); |
---|
72 | odo2.Set('chart.needle.color', 'black'); |
---|
73 | odo2.Set('chart.needle.tail', false); |
---|
74 | odo2.Set('chart.label.area', 35); |
---|
75 | odo2.Set('chart.border', RGraph.isIE8() ? false : true); |
---|
76 | odo2.Set('chart.title.vpos', 0.3); |
---|
77 | odo2.Set('chart.labels', ['N','NE','E','SE','S','SW','W','NW']); |
---|
78 | odo2.Set('chart.red.min', 360); |
---|
79 | odo2.Set('chart.red.color', 'gray'); |
---|
80 | odo2.Set('chart.value.text', true); |
---|
81 | odo2.Set('chart.value.units.post', '°'); |
---|
82 | odo2.Draw(); |
---|
83 | |
---|
84 | |
---|
85 | var odo3 = new RGraph.Odometer('odo3',0, 200, 160); |
---|
86 | odo3.Set('chart.green.max', 150); |
---|
87 | odo3.Set('chart.red.min', 175); |
---|
88 | odo3.Set('chart.shadow.inner', true); |
---|
89 | odo3.Set('chart.value.text', true); |
---|
90 | odo3.Set('chart.value.units.post', ' litres'); |
---|
91 | odo3.Draw(); |
---|
92 | } |
---|
93 | </script> |
---|
94 | |
---|
95 | <script> |
---|
96 | var _gaq = _gaq || []; |
---|
97 | _gaq.push(['_setAccount', 'UA-54706-2']); |
---|
98 | _gaq.push(['_trackPageview']); |
---|
99 | |
---|
100 | (function() { |
---|
101 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
---|
102 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
---|
103 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
---|
104 | })(); |
---|
105 | </script> |
---|
106 | </head> |
---|
107 | <body> |
---|
108 | |
---|
109 | |
---|
110 | <!-- Social networking buttons --> |
---|
111 | <div id="social_icons" class="warning" style="border-radius: 10px; top: 1px; position: fixed"> |
---|
112 | <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%20javascript%20charts%20library%20supporting%20a%20wide%20range%20of%20different%20charts%20types&title=RGraph:Javascript%20charts%20and%20graphs%20library" target="_blank"><img src="../images/delicious.png" alt="Bookmark with delicious" width="22" height="22" border="0" align="absmiddle" /></a> |
---|
113 | <a href="http://twitter.com/home/?status=RGraph%3A%20Javascript+charts+and+graph+library+http%3A%2F%2Fwww.rgraph.net+%23rgraph+%23html5+%23canvas+%23javascript+%23charts+@_rgraph" target="_blank"><img src="../images/twitter.png" id="twitter_icon" alt="tweet this site" width="22" height="22" border="0" align="absmiddle" /></a> |
---|
114 | </div> |
---|
115 | |
---|
116 | <script> |
---|
117 | // Opera fix |
---|
118 | if (navigator.userAgent.indexOf('Opera') == -1) { |
---|
119 | document.getElementById("social_icons").style.position = 'fixed'; |
---|
120 | } |
---|
121 | </script> |
---|
122 | <!-- Social networking buttons --> |
---|
123 | |
---|
124 | |
---|
125 | <h1>RGraph: <span>Javascript charts and graph library</span> - Odometer charts</h1> |
---|
126 | |
---|
127 | <script> |
---|
128 | if (RGraph.isIE8()) { |
---|
129 | 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 charts, 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://support.rgraph.net/message/rgraph-in-internet-explorer-9.html" target="_blank">here</a> to see some screenshots.</div>'); |
---|
130 | } |
---|
131 | </script> |
---|
132 | |
---|
133 | |
---|
134 | <div id="breadcrumb"> |
---|
135 | <a href="../index.html">RGraph: Javascript charts and graph library</a> |
---|
136 | > |
---|
137 | <a href="./index.html">Examples</a> |
---|
138 | > |
---|
139 | Odometer charts |
---|
140 | </div> |
---|
141 | |
---|
142 | <div> |
---|
143 | <p> |
---|
144 | Odometer charts can be used to provide an indication of a particular value. For example you could easily use them to |
---|
145 | represent values for a control panel that shows information about a server. Odometer charts indicating how much disk |
---|
146 | space is used for example, would be more visual than a simple number. |
---|
147 | </p> |
---|
148 | |
---|
149 | <p> |
---|
150 | The green, yellow and red areas are configurable, allowing you to add some level of urgency into your figures |
---|
151 | (as are the colors). The |
---|
152 | figures are also configurable, so it can go from 0-10, or from 0-100. |
---|
153 | </p> |
---|
154 | </div> |
---|
155 | |
---|
156 | <div> |
---|
157 | <ul> |
---|
158 | <li><a href="../docs/odo.html">Odometer charts API documentation</a></li> |
---|
159 | </ul> |
---|
160 | </div> |
---|
161 | |
---|
162 | <canvas id="odo1" width="300" height="300">[No canvas support]</canvas> |
---|
163 | <canvas id="odo2" width="300" height="300">[No canvas support]</canvas> |
---|
164 | <canvas id="odo3" width="300" height="300">[No canvas support]</canvas> |
---|
165 | </body> |
---|
166 | </html> |
---|