| Server IP : 104.21.80.248 / Your IP : 172.71.28.156 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Inetpub/www/myschool/triamudom/check/RGraph/docs/ |
Upload File : |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<!--
/**
* o------------------------------------------------------------------------------o
* | This file is part of the RGraph package - you can learn more at: |
* | |
* | http://www.rgraph.net |
* | |
* | This package is licensed under the RGraph license. For all kinds of business |
* | purposes there is a small one-time licensing fee to pay and for non |
* | commercial purposes it is free to use. You can read the full license here: |
* | |
* | http://www.rgraph.net/LICENSE.txt |
* o------------------------------------------------------------------------------o
*/
-->
<title>Displaying financial data</title>
<meta name="keywords" content="rgraph html5 canvas financial chart example" />
<meta name="description" content="Example of using the Scatter chart for financial data" />
<meta property="og:title" content="RGraph: HTML5 Javascript charts library" />
<meta property="og:description" content="A charts library based on the HTML5 canvas tag" />
<meta property="og:image" content="http://www.rgraph.net/images/logo.jpg"/>
<link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
<link rel="icon" type="image/png" href="../images/favicon.png">
<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script src="../libraries/RGraph.common.core.js"></script>
<script src="../libraries/RGraph.common.tooltips.js"></script>
<script src="../libraries/RGraph.scatter.js"></script>
<script src="../libraries/financial-data.js"></script>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-54706-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
window.onload = function ()
{
var s = new RGraph.Scatter('cvs', data);
s.Set('chart.ymin', 0.5);
s.Set('chart.ymax', 1);
s.Set('chart.xmin', Date.UTC(2007,0,1));
s.Set('chart.xmax', Date.UTC(2010,11,31));
s.Set('chart.labels', [ ['2007', Date.UTC(2007,0,1)],['2008', Date.UTC(2008,0,1)],['2009', Date.UTC(2009,0,1)],['2010', Date.UTC(2010,0,1)]]);
s.Set('chart.labels.specific.align', 'center');
s.Set('chart.tickmarks', null);
s.Set('chart.line', true);
s.Set('chart.line.colors', ['red']);
s.Set('chart.units.pre', '$');
s.Set('chart.gutter.left', 40);
s.Set('chart.title', 'Euro/Dollar exchange rate data over the past 4 years');
s.Set('chart.tooltips.effect', 'snap');
s.Set('chart.background.grid.autofit.numvlines', 16);
s.Set('chart.scale.decimals', 2);
s.Draw();
}
</script>
</head>
<body id="licensing">
<a name="top"></a>
<!-- Social networking buttons -->
<?php
$prefix = substr($_SERVER['SERVER_NAME'], 0, 3);
require("/rgraph.{$prefix}/social.html");
?>
<!-- Social networking buttons -->
<div id="breadcrumb">
<a href="../index.html">RGraph: HTML5 Javascript charts library</a>
>
<a href="./index.html">Documentation</a>
>
Displaying financial data
</div>
<h1>Displaying <span>financial data</span></h1>
<canvas id="cvs" width="600" height="250" style="float: right">[No canvas support]</canvas>
<p>
RGraph can be used to display financial information, as shown here. In this case the chart is showing exchange rate
information for the period 2008 - 2010.
</p>
<p>
Because the Line chart has no concept of an X axis scale, the Scatter chart with a connecting line is used to show the data.
</p>
<p>
<b>Note:</b>
If you don't have a lot of data then if you use a connecting line (as it is here) it may look jagged - particularly if
your data jumps from a high value to a low value or vice versa.
</p>
<p>
The chart uses data that is held in a separate file (because there's a lot of it). You can see this file here:
<a href="../libraries/financial-data.js">financial-data.js</a>
</p>
<br clear="all" />
<pre class="code">
<script>
window.onload = function ()
{
// The data variable is defined in the external file
var s = new RGraph.Scatter('cvs', data);
s.Set('chart.ymin', 0.5);
s.Set('chart.xmin', Date.UTC(2007,0,1));
s.Set('chart.xmax', Date.UTC(2010,11,31));
s.Set('chart.labels', [ ['2007', Date.UTC(2007,0,1)],['2008', Date.UTC(2008,0,1)],['2009', Date.UTC(2009,0,1)],['2010', Date.UTC(2010,0,1)]]);
s.Set('chart.labels.specific.align', 'center');
s.Set('chart.tickmarks', null);
s.Set('chart.line', true);
s.Set('chart.line.colors', ['red']);
s.Set('chart.units.pre', '$');
s.Set('chart.gutter.left', 35);
s.Set('chart.title', 'Euro exchange rate data over the past 4 years');
s.Set('chart.tooltips.effect', 'snap');
s.Set('chart.background.grid.autofit.numvlines', 16);
s.Set('chart.scale.decimals', 2);
s.Draw();
}
</script>
</pre>
</body>
</html>