4 <meta http-equiv=
"X-UA-Compatible" content=
"IE=EmulateIE7; IE=EmulateIE9">
7 <script type=
"text/javascript" src=
"../excanvas.js"></script>
10 For production (minified) code, use:
11 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
13 <script type=
"text/javascript" src=
"../dygraph-dev.js"></script>
18 <h1>Potential Y Axis formatting problems for small values
</h1>
20 <p>The problem using default y axis formatting for very small values:
<br/>
21 (this was more of a problem before dygraphs automatically switched to scientific notation)
</p>
22 <div id=
"graph1"></div>
23 <script type=
"text/javascript">
25 document.getElementById(
"graph1"),
40 <p>The solution using a Y axis formatting function:
</p>
41 <div id=
"graph2"></div>
42 <script type=
"text/javascript">
44 document.getElementById(
"graph2"),
54 labels: [
"X",
"Data"],
57 valueFormatter: function(x) {
58 var shift = Math.pow(
10,
5)
59 return Math.round(x * shift) / shift
67 <p>Different yValueFormatter and yAxisLabelFormatter functions:
</p>
68 <div id=
"graph3"></div>
69 <script type=
"text/javascript">
71 document.getElementById(
"graph3"),
81 labels: [
"X",
"Data"],
84 valueFormatter: function(x) {
85 var shift = Math.pow(
10,
5)
86 return
"*" + Math.round(x * shift) / shift
88 axisLabelFormatter: function(x) {
89 var shift = Math.pow(
10,
5)
90 return
"+" + Math.round(x * shift) / shift