+<!DOCTYPE html>
<html>
<head>
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
<title>dygraph</title>
<!--[if IE]>
- <script type="text/javascript" src="excanvas.js"></script>
+ <script type="text/javascript" src="../excanvas.js"></script>
<![endif]-->
- <script type="text/javascript" src="../strftime/strftime-min.js"></script>
- <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
- <script type="text/javascript" src="../dygraph-canvas.js"></script>
- <script type="text/javascript" src="../dygraph.js"></script>
+ <!--
+ For production (minified) code, use:
+ <script type="text/javascript" src="dygraph-combined.js"></script>
+ -->
+ <script type="text/javascript" src="../dygraph-dev.js"></script>
+
</head>
<body>
<h1>Potential Y Axis formatting problems for small values</h1>
- <p>The problem using default y axis formatting for very small values:</p>
+ <p>The problem using default y axis formatting for very small values:<br/>
+ (this was more of a problem before dygraphs automatically switched to scientific notation)</p>
<div id="graph1"></div>
<script type="text/javascript">
new Dygraph(
],
{
stepPlot: true,
- yValueFormatter: function(x) {
- var shift = Math.pow(10, 5)
- return Math.round(x * shift) / shift
- },
- labels: ["X", "Data"]
+ labels: ["X", "Data"],
+ axes: {
+ y: {
+ valueFormatter: function(x) {
+ var shift = Math.pow(10, 5)
+ return Math.round(x * shift) / shift
+ },
+ }
+ }
}
);
</script>
],
{
stepPlot: true,
- yValueFormatter: function(x) {
- var shift = Math.pow(10, 5)
- return "*" + Math.round(x * shift) / shift
- },
- yAxisLabelFormatter: function(x) {
- var shift = Math.pow(10, 5)
- return "+" + Math.round(x * shift) / shift
- },
- labels: ["X", "Data"]
+ labels: ["X", "Data"],
+ axes: {
+ y: {
+ valueFormatter: function(x) {
+ var shift = Math.pow(10, 5)
+ return "*" + Math.round(x * shift) / shift
+ },
+ axisLabelFormatter: function(x) {
+ var shift = Math.pow(10, 5)
+ return "+" + Math.round(x * shift) / shift
+ }
+ }
+ }
}
);
</script>