|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
<html> |
|
<head> |
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
|
<title>Flotr: Logarithmic Scale Example</title> |
|
<link rel="stylesheet" href="style.css" type="text/css" /> |
|
|
|
<script type="text/javascript" src="../../flotr/prototype/lib/prototype.js"></script> |
|
<script type="text/javascript" src="examples.js"></script> |
|
|
|
<!--[if IE]> |
|
<script type="text/javascript" src="../../flotr/prototype/lib/excanvas.js"></script> |
|
<script type="text/javascript" src="../../flotr/prototype/lib/base64.js"></script> |
|
<![endif]--> |
|
<script type="text/javascript" src="../../flotr/prototype/lib/canvas2image.js"></script> |
|
<script type="text/javascript" src="../../flotr/prototype/lib/canvastext.js"></script> |
|
<script type="text/javascript" src="../../flotr/prototype/flotr.js"></script> |
|
</head> |
|
<body> |
|
|
|
<!-- ad --> |
|
|
|
<div id="wrapper"> |
|
<h1></h1> |
|
<div id="container" style="width:600px;height:600px;"></div> |
|
<h2>Example</h2> |
|
<p>This graph shows how logarithmic scale is handled</p> |
|
<p>Finished? Go to the example <a href="index.html" title="Flotr Example Index Page">index page</a>, play with the <a href="../../playground/index.html" title="Flotr playground">playground</a> or read the <a href="http://www.solutoire.com/flotr/docs/" title="Flotr Documentation Pages">Flotr Documentation Pages</a>.</p> |
|
<h2>The Code</h2> |
|
<pre id="code-view"><code class="javascript"></code></pre> |
|
<div id="footer">Copyright © 2008 Bas Wenneker, <a href="http://www.solutoire.com">solutoire.com</a></div> |
|
</div> |
|
|
|
<!-- ad --> |
|
|
|
<script type="text/javascript"> |
|
window.onload= function(){ |
|
var d1 = []; |
|
|
|
var i; |
|
for(i = -10; i <= 10; i += 0.1){ |
|
d1.push([i, Math.exp(i)]); |
|
} |
|
|
|
/** |
|
* Draw the graph. |
|
*/ |
|
var f = Flotr.draw( |
|
$('container'),[ |
|
{data:d1, label:'exp(x)'} |
|
],{ |
|
yaxis:{ |
|
ticks: [10e-5, 10e-4, 10e-3, 10e-2, 10e-1, 10e0, 10e1, 10e2, 10e3, 10e4, 10e5], |
|
scaling:'logarithmic', |
|
//base: 0.5, |
|
min: 10e-6, |
|
max: 10e6 |
|
}, |
|
spreadsheet:{ |
|
show: true |
|
}, |
|
mouse: {track: true} |
|
}); |
|
} |
|
</script> |
|
|
|
<!-- analytics --> |
|
|
|
</body> |
|
</html> |
|
|