source: Dev/branches/Cartis/jahoor.php @ 228

Last change on this file since 228 was 207, checked in by cartis, 13 years ago

Got latest classes from trunk & update 05-12-2012

File size: 9.7 KB
RevLine 
[207]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        /**
9        * o------------------------------------------------------------------------------o
10        * | This file is part of the RGraph package - you can learn more at:             |
11        * |                                                                              |
12        * |                          http://www.rgraph.net                               |
13        * |                                                                              |
14        * | This package is licensed under the RGraph license. For all kinds of business |
15        * | purposes there is a small one-time licensing fee to pay and for non          |
16        * | commercial  purposes it is free to use. You can read the full license here:  |
17        * |                                                                              |
18        * |                      http://www.rgraph.net/LICENSE.txt                       |
19        * o------------------------------------------------------------------------------o
20        */
21    -->
22    <title>RGraph: Javascript charts and graph library - line charts</title>
23   
24    <meta name="keywords" content="rgraph html5 canvas example line chart" />
25    <meta name="description" content="RGraph: Javascript charts and graph library - Line chart example" />
26   
27    <meta property="og:title" content="RGraph: Javascript charts and graph library" />
28    <meta property="og:description" content="A charts library based on the HTML5 canvas tag" />
29    <meta property="og:image" content="http://www.rgraph.net/images/logo.png"/>
30 
31    <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
32    <link rel="icon" type="image/png" href="../images/favicon.png">
33 
34    <script src="../libraries/RGraph.common.core.js" ></script>
35    <script src="../libraries/RGraph.common.context.js" ></script>
36    <script src="../libraries/RGraph.common.annotate.js" ></script>
37    <script src="../libraries/RGraph.common.tooltips.js" ></script>
38    <script src="../libraries/RGraph.common.zoom.js" ></script>
39    <script src="../libraries/RGraph.common.resizing.js" ></script>
40    <script src="../libraries/RGraph.line.js" ></script>
41    <!--[if IE 8]><script src="../excanvas/excanvas.original.js"></script><![endif]-->
42 
43    <script>
44        window.onload = function ()
45        {
46            var line1 = new RGraph.Line('line1', [56,45,43,52,56,65,21,23,34,15,21,-12,-13,-31,-25], [35,43,41,41,42,46,42,39,46,41,45,65,54,54,41,41]);
47            line1.Set('chart.background.barcolor1', 'white');
48            line1.Set('chart.background.barcolor2', 'white');
49            line1.Set('chart.background.grid', true);
50            line1.Set('chart.linewidth', 5);
51            line1.Set('chart.gutter.left', 35);
52            line1.Set('chart.hmargin', 5);
53            line1.Set('chart.shadow', true);
54            line1.Set('chart.tickmarks', null);
55            line1.Set('chart.units.post', 'k');
56            line1.Set('chart.xticks', 8);
57            line1.Set('chart.colors', ['red', 'green']);
58            line1.Set('chart.key', ['Sales (not good)','Costs (reasonably consistent)']);
59            line1.Set('chart.key.shadow', true);
60            line1.Set('chart.key.shadow.offsetx', 0);
61            line1.Set('chart.key.shadow.offsety', 0);
62            line1.Set('chart.key.shadow.blur', 15);
63            line1.Set('chart.key.shadow.color', '#ddd');
64            line1.Set('chart.key.rounded', true);
65            line1.Set('chart.key.position', 'graph');
66            line1.Set('chart.key.position.x', line1.Get('chart.gutter.left') + 4);
67            line1.Set('chart.key.position.y', (line1.canvas.height / 2) + 5);
68            line1.Set('chart.xaxispos', 'center');
69            line1.Set('chart.background.grid.autofit', true);
70            line1.Set('chart.background.grid.autofit.numhlines', 16);
71            line1.Set('chart.title', 'Sales last year');
72            line1.Draw();
73           
74            var line2 = new RGraph.Line('line2', [6,5,4,5,6,4,1,2,3], [7,8,9,9,8,7,8,7,6]);
75            line2.Set('chart.labels', ['13th','14th','15th','16th','15th','16th','17th','18th','19th']);
76            line2.Set('chart.title', 'Range of fuel consumption');
77            line2.Set('chart.title.vpos', 0.5);
78            line2.Set('chart.background.barcolor1', 'white');
79            line2.Set('chart.background.barcolor2', 'white');
80            line2.Set('chart.filled', true);
81            line2.Set('chart.filled.range', true);
82            line2.Set('chart.fillstyle', 'rgba(128,255,128,0.5)');
83            line2.Set('chart.linewidth', 2);
84            line2.Set('chart.colors', ['green']);
85            line2.Set('chart.hmargin', 5);
86            line2.Draw();
87        }
88    </script>
89 
90    <script>
91      var _gaq = _gaq || [];
92      _gaq.push(['_setAccount', 'UA-54706-2']);
93      _gaq.push(['_trackPageview']);
94   
95      (function() {
96        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
97        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
98        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
99      })();
100    </script>
101   
102        <script>
103    window.onload = function ()
104    {
105        var data = [10,4,17,50,25,19,20,25,30,29,30,29];
106   
107        var line = new RGraph.Line("myLine", data);
108        line.Set('chart.background.barcolor1', 'rgba(255,255,255,1)');
109        line.Set('chart.background.barcolor2', 'rgba(255,255,255,1)');
110        line.Set('chart.background.grid.color', 'rgba(238,238,238,1)');
111        line.Set('chart.colors', ['rgba(255,0,0,1)']);
112        line.Set('chart.linewidth', 2);
113        line.Set('chart.filled', true);
114        line.Set('chart.hmargin', 5);
115        line.Set('chart.labels', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);
116        line.Set('chart.gutter.left', 40);
117        line.Draw();
118    }
119</script>
120
121 
122</head>
123<body> 
124 
125   
126    <!-- Social networking buttons -->
127        <div id="social_icons" class="warning" style="border-radius: 10px; top: 1px; position: fixed">
128            <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%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>
129            <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>
130        </div>
131 
132        <script>
133            // Opera fix
134            if (navigator.userAgent.indexOf('Opera') == -1) {
135              document.getElementById("social_icons").style.position = 'fixed';
136            }
137        </script>
138    <!-- Social networking buttons -->
139 
140 
141<div id="breadcrumb"> 
142    <a href="../index.html">RGraph: Javascript charts and graph library</a>
143    >
144    <a href="./index.html">Examples</a>
145    >
146    Line chart
147</div>
148 
149<h1>RGraph: <span>Javascript charts and graph library</span> - Line charts</h1>
150 
151    <script>
152        if (RGraph.isIE8()) {
153            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>');
154        }
155    </script>
156   
157    <div>
158        <p>
159            Like Bar charts, Line charts are some of the most versatile chart types. It is similar, but can indicate chronological
160            data better. Line charts are good if, for example, you want to illustrate sales figures over a year (or any period of
161            time). You'll then be able to easily see whether sales are going up, down or are stagnant. It will also become apparent
162            which months are busier than others. By using a multiple line chart you can add multiple sets of data (eg two or more years
163            of figures) to your chart. You can customise the line chart by stipulating it as being filled, having drop shadows, keys,
164            having the X axis in the centre, different colors, different tickmark styles and tooltips etc.
165        </p>
166       
167        <p>
168            The first chart uses external DIVs for the tooltip contents. The DIVs are at the bottom of this page (they're set not to
169            be visible). Using external DIVs for tooltips can make maintenance easier.
170        </p>
171   
172        <div>
173            <ul>
174                <li><a href="../docs/line.html">Line charts API documentation</a></li>
175            </ul>
176        </div>
177 
178        <div>
179            <canvas id="line1" width="475" height="250">[Please wait...]</canvas>
180            <canvas id="line2" width="475" height="250">[Please wait...]</canvas>
181        </div>
182    </div>
183 
184
185</body>
186</html>
187       
Note: See TracBrowser for help on using the repository browser.